#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <string>

using namespace std;

bool check(string s)
{
    size_t si = s.length();
    for (size_t i = 0; i < si / 2; i++)
        if (s[i] != s[si - i - 1])
            return false;
    return true;
}


string reverse(string s)
{
	string t = "";
	size_t si = s.length(); 
	for (size_t i = si; i > 0; i--)
		t += s[i - 1];
	return t;
}

int main()
{
    freopen("answer.in", "r", stdin);
    freopen("answer.out", "w", stdout);
    size_t n;
    cin >> n;
    vector<string> nor, inv;
    for (size_t i = 0; i < n; i++)
    {
        string s;
        cin >> s;
        nor.push_back(s);
		inv.push_back(reverse(s));
	}
	inv.push_back("-");
	inv.push_back("a");
	sort(inv.begin(), inv.end());
	for (size_t i = 0; i < n; i++)
	{
		size_t si = nor[i].length();
		for (size_t j = 1; j <= si; j++)
		{
			string p = nor[i].substr(0, j);
			string s = *lower_bound(inv.begin(), inv.end(), p);
			string rev = reverse(s);
			if (s == nor[i].substr(0, j) && rev != p)
			{
				string t = nor[i].substr(j, nor[i].length());
				for (size_t k = 0; k < n; k++)
				{
					if (i != k && check(t + nor[k]) && rev != nor[k])
					{
						cout << nor[i] << " " << nor[k] << " " << rev;
						return 0;
					}
				}
			}
		}
	}
	cout << "Sorry, but I don't know question!\n";
}