#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<complex>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
class UF{
public:
  int o[200100];
  int u[200100];
  UF(int n){
    for(int i=0;i<n;i++){
      o[i]=-1;
      u[i]=i;
    }
  }
  int root(int s){
    while(o[s]>=0)
      s=o[s];
    return u[s];
  }
  void merge(int x, int y){
    x = root(x);
    y = root(y);
    if(x == y) return;
    o[x]+=o[y];
    o[y]=x;
  }
  bool same(int x,int y){
    return root(x) == root(y);
  }
};
int main(){
  int n;
  while(cin>>n,n){
    UF uni(26);
    int alfaf[26]={};
    int alfae[26]={};
    for(int i=0;i<n;i++){
      string str;cin>>str;
      if((str[0]!=str[str.size()-1])){
	uni.merge(str[0]-'a',str[str.size()-1]-'a');
	alfaf[str[0]-'a']++;
	alfae[str[str.size()-1]-'a']++;
      }
    }
    int flag=0;
    for(int i=0;i<26;i++){
      if(uni.o[i]<0&&uni.o[i]!=-1)
	flag++;
    }
    bool flag2=true;
    for(int i=0;i<26;i++){
      if(alfaf[i]!=alfae[i]){
	flag2=false;
	//cout<<alfaf[i]<<" "<<alfae[i]<<endl;
	break;
      }
    }
    if(flag<2&&flag2==true)
      cout<<"OK"<<endl;
    else
      cout<<"NG"<<endl;
  }
  return 0;
}

