### 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

  links = words.map{|w| heads[w[-1]]}
  #p links

  used = words.map{false}
  used[0] = true

  stack = words.map{[0, 0]}
  sp = 0
  complete = false

  while sp >= 0
    #p stack

    id, k = stack[sp]
    link0 = links[id]

    if sp == n - 1
      if link0.include?(0)
        complete = true
        break
      end
      sp -= 1
      next
    end

    while k < link0.length
      break if ! used[link0[k]]
      k += 1
    end

    if k >= link0.length
      used[id] = false
      sp -= 1
      next
    end

    stack[sp][1] = k
    nid = link0[k]
    sp += 1
    stack[sp][0] = nid
    stack[sp][1] = 0
    used[nid] = true
  end

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