#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

char s[10000];
char g[10000];
int in[128];
int out[128];
bool chk[10000];
int n;

int cnt(int i){
  int ret = 1;
  chk[i] = true;
  REP(j,n)
    if((g[i] == s[j] || g[i] == g[j]) && !chk[j])
      ret += cnt(j);
  return ret;
}

int main(){
  while(scanf("%d ",&n), n){
    REP(i,128) in[i] = out[i] = 0;
    REP(i,n){
      char tmp[64];
      scanf("%s",tmp);
      s[i] = tmp[0];
      g[i] = tmp[strlen(tmp) - 1];

      in[s[i] - 'a']++;
      out[g[i] - 'a']++;
      chk[i] = false;
    }

    if(cnt(0) != n)
      goto ng;

    REP(i,128){
      if(in[i] != out[i])
        goto ng;
    }

    puts("OK");
    continue;

  ng:
    puts("NG");
    continue;
  }

  return 0;
}