import java.io.*;
import java.util.*;

public class JH
{
	public static final int SIZE = 12;
	public static final int MAXCHAR = 26;

	public static int n, newi, newj;
	public static boolean [] found = new boolean[MAXCHAR];
	public static int numFound;
	public static data [] data = new data[MAXCHAR];

	public static void main(String [] args)
	{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line ="";
		try {
			line = in.readLine();
		} catch (Exception e) {};
		n = Integer.parseInt(line);
		for(int i=0; i<MAXCHAR; i++) {
			data[i] = new data();
			data[i].p = new pos[3];
			for(int j=0; j<3; j++)
				data[i].p[j] = new pos();
		}
		while (n != 0) {
			numFound = 0;
			for(int i=0; i<MAXCHAR; i++) {
				found[i] = false;
				data[i].num = 0;
			}
			try {
				line = in.readLine();
			} catch (Exception e) {};
			int k = 0;
			for(int i=0; i<n; i++) {
				for(int j=0; j<=i; j++) {
					char ch = line.charAt(k++);
					int index = ch - 'a';
					data[index].p[data[index].num].i = i;
					data[index].p[data[index].num].j = j;
					data[index].num++;
				}
			}

			int i, j, tempi, tempj;
			boolean foundOne = false;
			for(int c=0; c<MAXCHAR; c++) {
				if (data[c].num < 3)
					continue;
				i = data[c].p[0].i;
				j = data[c].p[0].j;
				newi = data[c].p[1].i;
				newj = data[c].p[1].j;
				int d1 = newi-i;
				int d2 = newj-j;
				dir2(i, j, -d1);
				tempi = newi;
				tempj = newj;
				if (dir3(tempi, tempj, d2) && data[c].p[2].i == newi && data[c].p[2].j == newj) {
					found[c] = true;
					foundOne = true;
				}
				else {
					dir3(i, j, d1);
					tempi = newi;
					tempj = newj;
					if (dir1(tempi, tempj, -d2) && data[c].p[2].i == newi && data[c].p[2].j == newj) {
						found[c] = true;
						foundOne = true;
					}

				}
			}
			if (!foundOne)
				System.out.println("LOOOOOOOOSER!");
			else {
				for(i=0; i<MAXCHAR; i++)
					if (found[i]) System.out.print((char)('a'+i));
				System.out.println();
			}

			try {
				line = in.readLine();
			} catch (Exception e) {};
			n = Integer.parseInt(line);
		}
	}

	public static boolean dir1(int i, int j, int dist)
	{
		newi = i + dist;
		newj = j;
		return (newi>=0 && newi < n);
	}

	public static boolean dir2(int i, int j, int dist)
	{
		newi = i;
		newj = j+dist;
		return (newj>=0 && newj < n);
	}

	public static boolean dir3(int i, int j, int dist)
	{
		newi = i + dist;
		newj = j + dist;
		return (newi>=0 && newi < n && newj>=0 && newj<n);
	}
}

class pos{
	public int i, j;
};

class data {
	public int num;
	public pos [] p = new pos[3];
};
