#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;

bool circuit(vvi &to) {
    int in[26] = {}, ou[26] = {};
    for (int i=0; i<(int)to.size(); ++i) {
        for (int j: to[i]) {
            in[i] ++;
            ou[j] ++;
        }
    }
    for (int i=0; i<26; ++i) {
        if (in[i] != ou[i]) return false;
    }
    return true;
}

bool connected(vvi &to) {
    int s = 0;
    while (to[s].empty()) s ++;
    bool used[26] = {};
    stack<int> st;
    st.push(s);
    while ( ! st.empty()) {
        int t = st.top();
        st.pop();
        if (used[t]) continue;
        used[t] = true;
        for (int u: to[t]) st.push(u);
    }
    for (int i=0; i<(int)to.size(); ++i) {
        for (int j: to[i]) {
            if ( ! used[i] || ! used[j]) return false;
        }
    }
    return true;
}

int main() {
    int N;
    while (cin >> N, N) {
        vvi to(26);
        string s;
        for (int i=0; i<N; ++i) {
            cin >> s;
            to[s[0]-'a'].push_back(s.back()-'a');
        }
        if (circuit(to) && connected(to)) {
            cout << "OK\n";
        } else {
            cout << "NG\n";
        }
    }
    return 0;
}
