#include <iostream>
#include <vector>
#include <string>

using namespace std;

class UnionFind
{
public:
	int par[30], rank[30];
	void init()
	{
		for (int i = 0; i < 30; ++i)
		{
			par[i] = i;
			rank[i] = 0;
		}
	}
	int find(int x)
	{
		if (x == par[x])
		{
			return(x);
		}
		else
		{
			return(par[x] = find(par[x]));
		}
	}
	void unite(int a, int b)
	{
		a = find(a);
		b = find(b);
		if (rank[a] < rank[b])
		{
			par[a] = b;
		}
		else
		{
			par[b] = a;
			if (rank[a] == rank[b])
			{
				++rank[a];
			}
		}
	}
	bool same(int a, int b)
	{
		return(find(a) == find(b));
	}
};

void solve()
{
	int n;
	while (cin >> n, n)
	{
		UnionFind uf;
		uf.init();
		vector<int> cntFirst(26);
		vector<int> cntLast(26);
		for (int i = 0; i < n; ++i)
		{
			string s;
			cin >> s;
			++cntFirst[s[0] - 'a'];
			++cntLast[s[s.size() - 1] - 'a'];
			uf.unite(s[0] - 'a', s[s.size() - 1] - 'a');
		}
		bool isSameCharacter = true;
		for (int i = 0; i < 26; ++i)
		{
			if (cntFirst[i] != cntLast[i])
			{
				isSameCharacter = false;
				break;
			}
		}
		int root;
		for (int i = 0; i < 26; ++i)
		{
			if (cntFirst[i] != 0 && cntLast[i] != 0)
			{
				root = uf.find(i);
				break;
			}
		}
		bool isClosed = true;
		for (int i = 0; i < 26; ++i)
		{
			if (cntFirst[i] != 0 && cntLast[i] != 0)
			{
				if (root != uf.find(i))
				{
					isClosed = false;
				}
			}
		}
		if (!isSameCharacter || !isClosed)
		{
			cout << "NG" << endl;
		}
		else
		{
			cout << "OK" << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}