#include<bits/stdc++.h>
using namespace std;
string str;
void solve(){
while(cin>>str){
string tmp;
for(char &ch:str){
if(isupper(ch)){
tmp.push_back('_');
tmp.push_back(ch+32);
}else{
tmp.push_back(ch);
}
}
cout<<tmp<<"\n";
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
solve();
return 0;
}