#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<string> x;
vector<string> r;
string t;
int k = 0;
while(getline(cin, t))
{
x.push_back(t);
}
for(int i=0; i <(int) x.size(); i++)
{
string g, f="";
g=x[i];
for (int j=g.length()-1 ; j>=0 ; j--)
f+= x[i][j];
for(int j=i+1; j < (int)x.size(); j++)
{
if (f==x[j])
{
r.push_back(x[i]+" - "+f);
}
}
}
for(int i=0; i <(int) r.size(); i++)
{
cout<<r[i]<<endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpIHsKCXZlY3RvcjxzdHJpbmc+IHg7Cgl2ZWN0b3I8c3RyaW5nPiByOwoJc3RyaW5nIHQ7CglpbnQgayA9IDA7Cgl3aGlsZShnZXRsaW5lKGNpbiwgdCkpCgl7CQoJCXgucHVzaF9iYWNrKHQpOwoJfQoJZm9yKGludCBpPTA7IGkgPChpbnQpIHguc2l6ZSgpOyBpKyspCgl7CgkJc3RyaW5nIGcsIGY9IiI7CgkJZz14W2ldOwoJCWZvciAoaW50IGo9Zy5sZW5ndGgoKS0xIDsgaj49MCA7IGotLSkKCSAgICAJZis9IHhbaV1bal07CgkJZm9yKGludCBqPWkrMTsgaiA8IChpbnQpeC5zaXplKCk7IGorKykKCQl7CgkJCWlmIChmPT14W2pdKQoJCQl7CgkJCQlyLnB1c2hfYmFjayh4W2ldKyIgLSAiK2YpOwoJCQl9CgkJfQoJfQoJZm9yKGludCBpPTA7IGkgPChpbnQpIHIuc2l6ZSgpOyBpKyspCgl7CgkJY291dDw8cltpXTw8ZW5kbDsKCX0KCXJldHVybiAwOwp9