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

#define for_(i,a,b) for(int i=(a);i<(b);++i)


int n, indeg[26], outdeg[26];
bool vis[26];
vector< int > adj[26];

void dfs(int v) {
	vis[v] = true;
	for (int u : adj[v]) if (!vis[u]) dfs(u);
}

bool connected() {
	int cnt = 0;
	
	for_(v,0,26) {
		if (vis[v]) continue;
		++cnt; dfs(v);
	}
	
	return cnt == 1;
}

void solve() {
	memset(indeg, 0, sizeof(indeg));
	memset(outdeg, 0, sizeof(outdeg));
	
	for_(i,0,26) {
		adj[i].clear();
		vis[i] = true;
	}
	
	for_(i,0,n) {
		string s;
		cin >> s;
		int a = s[s.size() - 1] - 'a', b = s[0] - 'a';
		++indeg[a];
		++outdeg[b];
		adj[b].push_back(a);
		vis[b] = vis[a] = false;
	}
	
	bool ok = connected();
	for_(i,0,26) ok &= (indeg[i] == outdeg[i]);
	cout << (ok ? "OK" : "NG") << endl;
}

int main() { while (cin >> n, n) { solve(); } }