#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

bool visited[26], g[26][26];
int in[26], out[26];

void dfs(int v) {
    visited[v] = true;
    for (int u = 0; u < 26; u++) {
        if (visited[u]) continue;
        if (!g[v][u]) continue;
        dfs(u);
    }
}

int main() {
    int n;
    while (cin >> n && n) {
        for (int i = 0; i < 26; i++) {
            visited[i] = false;
            in[i] = out[i] = 0;
            for (int j = 0; j < 26; j++) {
                g[i][j] = false;
            }
        }
        for (int i = 0; i < n; i++) {
            string s;
            cin >> s;
            in[s.back() - 'a']++;
            out[s.front() - 'a']++;
            g[s.front() - 'a'][s.back() - 'a'] = true;
        }
        for (int i = 0; i < 26; i++) {
            if (in[i] == 0 && out[i] == 0) continue;
            dfs(i);
            break;
        }
        bool flag = true;
        for (int i = 0; i < 26; i++) {
            if (in[i] == 0 && out[i] == 0) continue;
            if (!visited[i]) flag = false;
        }
        for (int i = 0; i < 26; i++) {
            if (in[i] != out[i]) flag = false;
        }
        if (flag) cout << "OK" << endl;
        else cout << "NG" << endl;
    }
}
