(N, M, T), *XYs = $<.map{|l| l.split.map &:to_i }

if T == 1
  A = N.times.map{|i| 1 << i }
  XYs.reverse_each do |x, y|
    A[x-1] = A[y-1] |= A[x-1]
  end
  all = A.reduce :&
  if all == 0
    p -1
  else
    goal = N.times.find{|i| all[i] == 1 }
    ok = N.times.map{|i| i == goal }
    ans = XYs.reverse.map do |x, y|
      if ok[x-1]
        ok[y-1] = true
        ?^
      else
        ok[x-1] ||= ok[y-1]
        ?v
      end
    end
    puts ans.reverse.join
  end
end
