#include <bits/stdc++.h>
using namespace std;
class UnionFind {
	vector<int> data;
	int root(int a) {
		return data[a] < 0 ? a : data[a] = root(data[a]);
	}
public:
	UnionFind(int n) : data(n, -1) {}
	bool Find(int a, int b) {
		return root(a) == root(b);
	}
	void Union(int a, int b) {
		a = root(a);
		b = root(b);
		if (a == b) return;
		if (data[a] < data[b]) {
			data[a] += data[b];
			data[b] = a;
		}
		else {
			data[b] += data[a];
			data[a] = b;
		}
	}
	int Size(int a) {
		return -data[root(a)];
	}
};


int main()
{
	int n;
	string word;
	while (cin >> n, n) {
		int cnt = 0;
		vector<int> s(26), e(26), used(26);
		UnionFind uf(26);
		while (n--) {
			cin >> word;
			int f = word.front() - 'a', b = word.back() - 'a';
			s[f]++;
			e[b]++;
			uf.Union(f, b);
			if (!used[f]) {
				cnt++;
				used[f] = 1;
			}
			if (!used[b]) {
				cnt++;
				used[b] = 1;
			}
		}
		bool res = true;
		for (int i = 0; i < 26; i++) {
			if (s[i] != e[i]) {
				res = false;
				break;
			}
		}
		cout << (res && uf.Size(word.front() - 'a') == cnt ? "OK" : "NG") << endl;
	}
	return 0;
}