class DisjointSet
  attr_accessor :parent, :rank

  def initialize
    @parent = {}
    @rank = {}
  end

  def make(node)
    @parent[node] = node
    @rank[node] = 0
  end

  def union(node1, node2)
    link(find(node1), find(node2))
  end

  def link(node1, node2)
    node1, node2 = node2, node1 if @rank[node1] < @rank[node2]
    @parent[node2] = node1
    @rank[node1] += 1 if @rank[node1] == @rank[node2]
  end

  def find(node)
    (@parent[node] == node) ? node : (@parent[node] = find(@parent[node]))
  end
end

while true do
  n = gets.to_i
  break if n == 0
  set = DisjointSet.new
  word = []
  count = Hash.new(0)
  n.times do
    word.push(gets.chomp)
    from = word.last.chr
    to = word.last.reverse.chr
    count[from] += 1
    count[to] -= 1
    set.make(from) unless set.parent.key?(from)
    set.make(to) unless set.parent.key?(to)
    set.union(from, to)
  end
  ok = true
  count.each do |key, val|
    ok = false if val != 0
  end
  use = Hash.new
  set.parent.each do |key, val|
    use[set.find(key)] = true
  end
  ok = false if use.size != 1
  puts ok ? "OK" : "NG"
end