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

#define rep(i,n) for(int i=0;i<n;i++)
#define all(c) (c).begin(),(c).end()
#define fr(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define mp make_pair
#define pb push_back
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

const int inf=1<<28;
const double INF=1e12,EPS=1e-9;

char in[33];
int n,deg[26];
bool v[26];
vi e[26];

void dfs(int c){
  v[c]=1;
  fr(i,e[c])if(!v[*i])dfs(*i);
}
int main()
{
  while(scanf("%d",&n),n){
    rep(i,26)e[i].clear(),deg[i]=0,v[i]=1;
    int a,b;
    rep(i,n){
      scanf("%s",in);
      a=in[0]-'a'; b=in[strlen(in)-1]-'a';
      e[a].pb(b);
      deg[a]++; deg[b]--; v[a]=v[b]=0;
    }
    dfs(a);
    rep(i,26)if(!v[i]||deg[i]!=0){
      puts("NG"); goto END;
    }
    puts("OK"); END:;
  }
  return 0;
}