#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
//const int INF = 1e8;
using namespace std;

class EulerGraph{
	private:
		bool directed;
		bool isList;
		int degreeCheck(int a){
			if(a == 0) return EULER_GRAPH;
			else if(a == 2) return SEMI_EULER_GRAPH;
			else return 0;
		}
		int degreeCheck(vector<vector<int>> d){
			int s = 0, t = 0, p = 0;
			for(auto i : d){
				if(i[0] == i[1] + 1) s++;
				else if(i[0] + 1 == i[1]) t++;
				else if(i[0] == i[1]) p++;
				else return 0;
			}
			if(s == 0 && t == 0) return EULER_GRAPH;
			else if(s == 1 && t == 1) return SEMI_EULER_GRAPH;
			else return 0;
		}
		int checkEulerDirectedList(){
			vector<vector<int>> degree(g.size(), vector<int>(2,0)); //0:out, 1:in
			rep(i,g.size()){
				degree[i][0] = g[i].size();
				for(auto j : g[i]){
					degree[j][1]++;
				}
			}
			return degreeCheck(degree);
		}
		int checkEulerIndirectedList(){
			int a = 0;
			rep(i,g.size()){
				if(g[i].size() % 2) a++;
			}
			return degreeCheck(a);
		}
		int checkEulerDirectedMat(){
			vector<vector<int>> degree(g.size(), vector<int>(2,0)); //0:out, 1:in
			rep(i,g.size()){
				rep(j,g[i].size()){
					if(g[i][j] > 0){
						degree[i][0]++;
						degree[j][1]++;
					}
				}
			}
			return degreeCheck(degree);
		}
		int checkEulerIndirectedMat(){
			int a = 0;
			rep(i,g.size()){
				int degree = 0;
				rep(j,g[i].size()){
					if(g[i][j] > 0) degree++;
				}
				if(degree % 2) a++;
			}
			return degreeCheck(a);
		}
		//g?????£??\?????????
		//g?????´?£???????
		//?§?????????£??\?????????????????????????????????
		vector<int> ListEulerianTrail(const int s, const bool directed) {
			function<void (int, vector<int> &)> dfs = [&](int u, vector<int> &trail) {
				while (not g[u].empty()) {
					int v = g[u].back();
					g[u].pop_back();
					if (not directed) {
						for (int i = 0; i < g[v].size(); i ++) {
							if (g[v][i] == u) {
								g[v].erase(g[v].begin() + i);
								break;
							}
						}
					}
					dfs(v, trail);
				}
				trail.emplace_back(u);
			};
			vector<int> trail;
			dfs(s, trail);
			reverse(trail.begin(), trail.end());
			return trail;
		}
		//g?????£??\??????
		//g?????´?£???????
		vector<int> MatEulerianTrail(const int s, const bool directed) {
			function<void (int, vector<int> &)> dfs = [&](int u, vector<int> &trail) {
				for (int v = 0; v < g.size(); v ++) if (g[u][v] > 0) {
					g[u][v]--;
					if (not directed) g[v][u]--;
					dfs(v, trail);
				}
				trail.push_back(u);
			};
			vector<int> trail;
			dfs(s, trail);
			reverse(trail.begin(), trail.end());
			return trail;
		}
	public:
		vector<vector<int>> g;
		EulerGraph(vector<vector<int>> &g, bool directed, bool isList){
			this->g = g;
			this->directed = directed;
			this->isList = isList;
		}

		static const int EULER_GRAPH = 1;
		static const int SEMI_EULER_GRAPH = 2;
		int isEulerGraph(){
			if(isList){
				if(directed) return checkEulerDirectedList();
				else return checkEulerIndirectedList();
			}else{
				if(directed) return checkEulerDirectedMat();
				else return checkEulerIndirectedMat();
			}
			return -1;
		}
		vector<int> getEulerianTrail(const int s){
			if(isList) return ListEulerianTrail(s,directed);
			else return MatEulerianTrail(s, directed);
		}
};

const int gmax_n = 26;;

int par[gmax_n]; //???
int depth[gmax_n];//??¨?????±???

void init(int n){
	rep(i,n){
		par[i] = i;
		depth[i] = 0;
	}
}

int find(int x){
	if(par[x] == x){
		return x;
	}else {
		return par[x] = find(par[x]);
	}
}

void unite(int x, int y){
	x = find(x);
	y = find(y);
	if(x == y) return;

	if(depth[x] < depth[y]){
		par[x] = y;
	}else{
		par[y] = x;
		if(depth[x] == depth[y]) depth[x]++;
	}
}

bool same(int x, int y){
	return find(x) == find(y);
}

int main(){
	int n;
	while(cin >> n, n){
		vector<vector<int>> g('z' - 'a' + 1);
		set<int> used;
		init(26);
		rep(i,n){
			string s;
			cin >> s;

			int a = s.front() - 'a';
			int b = s.back() - 'a';

			unite(a,b);
			used.emplace(a);
			used.emplace(b);
			g[a].emplace_back(b);
		}
		auto f = [&]() -> bool{
			for(auto i : used){
				if(not same(*used.begin(),i)){
					return true;
				}
			}
			return false;
		};

		if(f()){
			cout << "NG" << endl;
			continue;
		}
		EulerGraph euler(g,1,1);
		cout << (euler.isEulerGraph() == EulerGraph::EULER_GRAPH ? "OK" : "NG") << endl;
	}
}

Measured memory_bytes: 3140