#include<iostream>
#include<vector>
#include<string>
#define REP(i, j) for(int i = 0; i < j; i++)
using namespace std;
const int N = 26;

vector<bool> visited(N, false);
void makeVisited(vector< vector<int> > &num, int now){
    REP(i, N){
        if(!visited[i] && num[now][i]){
            visited[i] = true;
            makeVisited(num, i);
        }
    }
}

bool checkVisited(vector<bool> &used, vector< vector<int> > &num){
    REP(i, N){
        if(used[i]){
            makeVisited(num, i);
            break;
        }
    }
    REP(i, N) if(used[i] && !visited[i]) return false;
    return true;
}

bool checkEuler(vector< vector<int> > &num, vector<bool> &used){
    REP(alpha, N){
        if(!used[alpha]) continue;
        int diff = 0;
        REP(i, N){
            diff += num[alpha][i];
            diff -= num[i][alpha];
        }
        if(diff) return false;
    }
    return true;
}

int main(){
    int n;
    while(cin >>n && n){
        visited = vector<bool>(N, false);
        vector< vector<int> > num(N, vector<int>(N, 0) );
        vector<bool> used(N, false);
        REP(i, n){
            string str;
            cin >>str;
            int top = str[0] - 'a', tail = str[str.size() - 1] - 'a';
            used[top] = true;
            used[tail] = true;
            num[top][tail]++;
        }

        if(!checkVisited(used, num)){
            cout <<"NG" <<endl;
            continue;
        }

        cout <<((checkEuler(num, used))? "OK" : "NG") <<endl;
    }
    return 0;
}