#include <iostream>
#include <vector>
#include <queue>
#include <string>
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
using namespace std;
int deg[26] = {};
vector<int> e[26];
bool v[26] = {};
void init() {
	rep(i,26) {
		deg[i] = 0;
		e[i].clear();
		v[i] = false;
	}
}
void dfs(int c) {
	v[c] = false;
	rep(i,e[c].size()) {
		if(v[e[c][i]]) dfs(e[c][i]);
	}
}
//bool bfs(int c) {
//	queue<int> q;
//	q.push(c);
//	while(!q.empty()) {
//		int x = q.front; q.pop();
//		if(!v[x]) continue;
//		v[x] = false;
//		rep(i,e[c].size()) {
//			if(e[c][i]) q.push(e[c][i]);
//		}
//	}
//	rep(i,26) if(deg[i]&&v[i]) return false;
//	return true;
//}
int main(){
	int n;
	string s;
	while(cin >> n, n) {	
		init();
		int a;
		rep(i,n) {
			cin >> s;
			a = s[0] - 'a';
			int b = s[s.size()-1] - 'a';
			e[a].push_back(b);
			deg[a]++, deg[b]--;
			v[a] = v[b] = true;
		}
		dfs(a);
		int i;
		for(i=0;i<26;++i) {
			if(v[i] || deg[i]!=0) {
				cout << "NG" << endl;
				break;
			}
		}
		if(i==26) cout << "OK" << endl;
		// if(bfs(a)) cout << "OK" << endl;
		// else cout << "NG" << endl;
	}
}