### subroutines

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

  while ! q.empty?
    u = q.shift

    for v in nodes
      if ! reached[v] && edges[u][v]
        reached[v] = true
        q << v
      end
    end
  end

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

### main

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

  edges = 26.times.map{26.times.map{0}}
  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

    edges[i0][i1] += 1
    nout[i0] += 1
    nin[i1] += 1
  end

  euler = true
  nodes = []

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

  puts ((euler && complete?(nodes, edges)) ? "OK" : "NG")
end