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 t;
a:
	foreach(i; 0..26){
		foreach(j; 0..26) {
			if(c[i][j]){
				arrived[i] = true;
				arrived[j] = true;
				t = j;
				break a;
			}
		}
	}
b:
	while(true) {
		foreach(i; 0..26) {
			if(c[t][i] > 0 && !arrived[i]){
				arrived[i] = true;
				t = i;
				continue b;
			}
		}
		break;
	}
	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());
	}
}