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

puts(
  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
      -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
      ans.reverse.join
    end
  else
    if N == 2
      -1
    else
      from = [1, 2, 3]
      ans = XYs.map do |x, y|
        if y > 3
          ?^
        elsif from[x] == from[6 - x - y]
          from[x] = from[y]
          ?v
        else
          from[y] = from[x]
          ?^
        end
      end
      ans.join
    end
  end
)
