#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
using namespace std;

struct Info{

	Info(){
		left = right = 'X';
		index = 0;
	}

	Info(char arg_left,char arg_right,int arg_index){
		left = arg_left;
		right = arg_right;
		index = arg_index;
	}
	char left,right;
	int index;
};

bool check[10000];
vector<Info> V[26];

void dfs(char left){
	for(int i = 0; i < V[left - 'a'].size(); i++){
		if(check[V[left - 'a'][i].index] == false){
			check[V[left - 'a'][i].index] = true;
			dfs(V[left - 'a'][i].right);
		}
	}
}

int main(){

	int N,num_left[26],num_right[26];

	bool FLG;

	char buf[33],last,final_start;

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		FLG = true;

		for(int i = 0; i < 26; i++){
			V[i].clear();
			num_left[i] = 0;
			num_right[i] = 0;
		}
		for(int i = 0; i < N; i++)check[i] = false;

		for(int i = 0; i < N; i++){
			scanf("%s",buf);
			num_left[buf[0] - 'a']++;
			for(int k = 0; buf[k] != '\0'; k++)last = buf[k];
			num_right[last - 'a']++;
			V[buf[0]-'a'].push_back(Info(buf[0],last,i));
			final_start = buf[0];
		}

		for(int i = 0; i < 26; i++){
			if(num_left[i] != num_right[i]){
				printf("NG\n");
				FLG = false;
				break;
			}
		}

		if(!FLG)continue;

		check[V[final_start - 'a'][0].index] = true;
		dfs(V[final_start - 'a'][0].right);

		for(int i = 0; i < N; i++){
			if(check[i] == false){
				printf("NG\n");
				FLG = false;
				break;
			}
		}

		if(!FLG)continue;

		printf("OK\n");

	}

    return 0;
}