#include<bits/stdc++.h>
using namespace std;
string s1,s2,s3;
char ch;
void solve(){
while(cin>>ch){
if(isalpha(ch))s1.push_back(ch);
else if(isdigit(ch))s2.push_back(ch);
else s3.push_back(ch);
}
cout<<s1<<"\n"<<s2<<"\n"<<s3;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
solve();
return 0;
}