#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for ( int i = 0; i < n; i++)
int n, in[26], out[26], G[26][26];
bool visited[26];
bool check() {
	rep(i, 26)
		if (in[i] != out[i])
			return false;
	return true;
}
void dfs(int u) {
	visited[u] = true;
	rep(v, 26)
		if (!visited[v] && G[u][v])
			dfs(v);
}
int getNComponent() {
	int nc = 0;
	rep(i, 26)
	{
		if (in[i] == 0 && out[i] == 0)
			continue;
		if (!visited[i]) {
			nc++;
			dfs(i);
		}
	}
	return nc;
}
int main() {
	while (cin >> n && n) {
		rep(i, 26)
		{
			in[i] = out[i] = 0;
			visited[i] = false;
			rep(j, 26)
				G[i][j] = 0;
		}
		string str;
		rep(i, n)
		{
			cin >> str;
			in[str[0] - 'a']++;
			out[str[str.size() - 1] - 'a']++;
			G[str[0] - 'a'][str[str.size() - 1] - 'a'] = 1;
			G[str[str.size() - 1] - 'a'][str[0] - 'a'] = 1;
		}
		cout << ((check() && getNComponent() == 1) ? "OK" : "NG") << endl;
	}
	return 0;
}