### main

while true
  n = gets.strip.to_i
  break if n == 0

  words = n.times.map{gets.strip}

  heads = {}
  tails = {}
  ('a'..'z').each{|c| heads[c] = []; tails[c] = []}

  words.each_with_index do |w, i|
    heads[w[0]] << i
    tails[w[-1]] << i
  end

  nolink = false
  words.each do |w|
    if heads[w[-1]].empty? || tails[w[0]].empty?
      nolink = true
      break
    end
  end

  if nolink
    puts "NG"
    next
  end

  used = words.map{false}
  used[0] = true
  stack = [[0, 0, heads[words[0][-1]]]]
  complete = false

  while ! stack.empty?
    id, k, nexts = stack[-1]

    if stack.length >= n
      if words[id][-1] == words[0][0]
        complete = true
        break
      end

      stack.pop
      used[id] = false
      next
    end

    while k < nexts.length
      nid = nexts[k]
      break if ! used[nid]
    end

    if k >= nexts.length
      stack.pop
      used[id] = false
    else
      stack[-1][1] = k
      used[nid] = true
      stack << [nid, 0, heads[words[nid][-1]]]
    end
  end

  puts (complete ? "OK" : "NG")
end