### subroutines

def complete?(nodes, edges)
  reached = (0..25).map{false}
  reached[nodes[0]] = true
  q = [nodes[0]]

  while ! q.empty?
    i0 = q.shift

    for i1 in nodes
      if ! reached[i1] && edges[i0][i1]
        reached[i1] = true
        q << i1
      end
    end
  end

  for i0 in nodes
    return false if ! reached[i0]
  end
  true
end

### main

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

  nhash = {}
  edges = 26.times.map{26.times.map{false}}
  nout = 26.times.map{0}
  nin  = 26.times.map{0}

  n.times do
    w = gets.strip

    i0 = w[0].ord - 'a'.ord
    i1 = w[-1].ord - 'a'.ord

    if i0 != i1
      edges[i0][i1] = true
      nout[i0] += 1
      nin[i1] += 1
    end
    nhash[i0] = nhash[i1] = 1
  end

  euler = true

  for i in (0..25)
    if nin[i] != nout[i]
      euler = false
      break
    end
  end

  euler &&= complete?(nhash.keys.sort, edges)

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