#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
using namespace std;
typedef long long ll;
const int c = 'A' - 'a';
void deal(string &inp){
for(int i = 0; i < inp.size(); ++i)
if(inp[i] >= 'A' && inp[i] <= 'Z')
inp[i] -= c;
}
int main(){
vector<string> alstr, dalstr, out;
string str, tstr;
map<string, int> all;
while(cin >> str){
if(str[0] == '#')
break;
tstr = str;
deal(tstr);
sort(tstr.begin(), tstr.end());
alstr .push_back(str );
dalstr.push_back(tstr);
if(!all.count(tstr))all[tstr] = 0;
++all[tstr];
}
for (int i = 0; i < dalstr.size(); ++i)
if(all[dalstr[i]] == 1)
out.push_back(alstr[i]);
sort(out.begin(), out.end());
for(int i = 0; i < out.size(); ++i){
cout << out[i] <<endl;
}
return 0;
}
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
using namespace std;
typedef long long ll;
const int c = 'A' - 'a';
void deal(string &inp){
for(int i = 0; i < inp.size(); ++i)
if(inp[i] >= 'A' && inp[i] <= 'Z')
inp[i] -= c;
}
int main(){
vector<string> alstr, dalstr, out;
string str, tstr;
map<string, int> all;
while(cin >> str){
if(str[0] == '#')
break;
tstr = str;
deal(tstr);
sort(tstr.begin(), tstr.end());
alstr .push_back(str );
dalstr.push_back(tstr);
if(!all.count(tstr))all[tstr] = 0;
++all[tstr];
}
for (int i = 0; i < dalstr.size(); ++i)
if(all[dalstr[i]] == 1)
out.push_back(alstr[i]);
sort(out.begin(), out.end());
for(int i = 0; i < out.size(); ++i){
cout << out[i] <<endl;
}
return 0;
}