#include <iostream>
#include <string>
#include <vector>
using namespace std;

vector<vector<int> > edge;
int odeg[26], ideg[26];
int check[26];

int foo(int n) {
	if(check[n]<=0)
		return 0;
	check[n] = 0;
	for(int i = 0; i < edge[n].size(); i++)
		foo(edge[n][i]);
	return 1;
}

int main() {
	int n;
	while(cin >> n, n) {
		edge.clear();
		edge.resize(26);
		for(int i = 0; i < 26; i++) {
			odeg[i] = ideg[i] = check[i];
			check[i] = -1;
		}
		for(int i = 0; i < n; i++) {
			string s;
			cin >> s;
			int a, b;
			a = s[0]-'a'; b = s[s.size()-1] -'a';
			edge[a].push_back(b);
			odeg[a]++;
			ideg[b]++;
			check[a] = 1;
		}
		int a = 0;
		bool flg = true;
		for(int i = 0; i < 26; i++) {
			flg &= odeg[i] == ideg[i];
		}
		for(int i = 0; i < 26; i++) {
			a += foo(i);
		}
		if(flg && a == 1)
			cout << "OK" << endl;
		else
			cout << "NG" << endl;
	}
}