#include<iostream>
#include<queue>
#include<string>

using namespace std;

int main()
{
  while(true){
    int n;
    bool ng = false;
    bool adj[32][32] = {{false,},};
    bool exist[32] = {false,};
    int in[32] = {0,};
    int out[32] = {0,};
    cin >> n;
    if( n == 0 ) break;
    string s;
    for(int i = 0; i < n; ++i){
      cin >> s;
      int src=s[0]-'a';
      int dst=s[s.length()-1]-'a';
      exist[ src ] = exist[ dst ] = true;
      adj[ src ][ dst ] = true;
      in[ dst ]++;
      out[ src ]++;
    }
    bool vis[32]={false,};
    queue<int> qs;
    qs.push(s[0]-'a');
    vis[s[0]-'a']=true;
    while(!qs.empty()){
      int now=qs.front();qs.pop();
      for(int i=0;i<32;++i){
	if(adj[now][i]&&!vis[i]){
	  vis[i]=true;
	  qs.push(i);
	}
      }
    }
    for(int i = 0; i < 32; ++i){
      if( exist[i] ){
	if( !vis[i] ) ng = true;
	if( (in[i]-out[i]) != 0 ){
	  ng=true;
	}
      }
    }
    if( ng ){
      cout << "NG" << endl;
    }else{
      cout << "OK" << endl;
    }
  }
  
  return 0;
}