#include<bits/stdc++.h>
using namespace std;

vector<int>rinsetu[26];
int in[26], out[26];
bool flag[26];
void dfs(int a) {
	flag[a] = true;
	for (int b : rinsetu[a]) {
		if (!flag[b]) {
			dfs(b);
		}
	}
}
signed main() {
	int a;
	while (cin >> a, a) {
		for (int i = 0; i < 26; i++) {
			in[i] = out[i] = flag[i] = 0;
			rinsetu[i].clear();
		}
		int S=0;
		for (int b = 0; b < a; b++) {
			string c; cin >> c;
			S = c[0] - 'a';
			in[*c.rbegin() - 'a']++;
			out[c[0] - 'a']++;
			rinsetu[c[0] - 'a'].push_back(*c.rbegin() - 'a');
		}
		bool k = true;
		for (int i = 0; i < 26; i++) {
			if (in[i] != out[i])k = false;
		}
		dfs(S);
		for (int i = 0; i < 26; i++) {
			if (in[i] && !flag[i])k = false;
		}
		if (k)puts("OK");
		else puts("NG");
	}
}