#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;
}