import std.stdio;
import std.algorithm;
import std.string;
import std.range;
import std.array;
import std.conv;
import std.complex;
import std.math;
import std.ascii;
import std.bigint;
import std.container;

bool isConnected(int[26][] c) {
	bool[26] appear;
	foreach(i; 0..26) {
		foreach(j; 0..26) {
			if(c[i][j]) {
				appear[i] = true;
				appear[j] = true;
			}
		}
	}

	bool[26] arrived;

	int[] next;
	foreach(i; 0..26){
		foreach(j; 0..26) {
			if(c[i][j]){
				arrived[i] = true;
				arrived[j] = true;
				next ~= j;
			}
		}
		if(!next.empty())
			break;
	}

	while(!next.empty()) {
		int[] newNext;
		foreach(t; next) {
			foreach(i; 0..26) {
				if(!arrived[i] && c[t][i]){
					arrived[i] = true;
					newNext ~= i;
				}
			}
		}
		next = newNext;
	}
	return appear == arrived;
}

bool isEuler(int[26][] c) {
	foreach(i; 0..26) {
		int to, from;
		foreach(j; 0..26) {
			to += c[j][i];
			from += c[i][j];
		}
		if(to != from)
			return false;
	}
	return true;
}

void main() {
	auto n = to!int(readln().strip());
	while(n) {
		int[26][26] c;
		bool[26] appear;
		foreach(i; 0..n) {
			auto l = readln().strip();
			int s = l[0]-'a';
			int t = l[$-1]-'a';
			appear[s] = true;
			appear[t] = true;
			++c[s][t];
		}

		if(isConnected(c) && isEuler(c))
			writeln("OK");
		else
			writeln("NG");

		n = to!int(readln().strip());
	}
}