#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int path[26][26];
int visited[26];

int dfs(int src,int* visited){
    visited[src] = 1;
    int res = 1;
    for(int i=0;i<26;i++){
        if(path[src][i] && visited[i] == 0){
            res += dfs(i,visited);
        }
    }
    return res;
}

int main(){
    int n;
    
    while(~scanf("%d",&n)){
        if(n==0) break;
        memset(path,0,sizeof(path));
        memset(visited,0,sizeof(visited));
        set<int> src;
        for(int i=0;i<n;i++){
            string str;
            cin >> str;
            path[*str.begin()-'a'][*(str.end()-1)-'a']++;
            
            src.insert(*(str.end()-1)-'a');
            src.insert(*str.begin()-'a');
        }
        
        if(src.size() != dfs(*src.begin(),visited)){
            printf("NG\n");
            continue;
        }
        
        bool isok=true;
        
        for(set<int>::iterator it = src.begin(); it != src.end(); it++){
            int out=0;
            for(int j=0;j<26;j++){
                out += path[*it][j];
            }
            
            int in=0;
            for(int j=0;j<26;j++){
                in += path[j][*it];
            }
            
            if(out != in) isok = false;
        }
        
        printf("%s\n",isok ? "OK" : "NG");
    }
}