import std.algorithm, std.array, std.conv, std.range, std.stdio, std.string;
void main()
{
    auto buf = readln.chomp.split.to!(int[]);
    assert (buf[2] == 1);
    immutable cables = buf[0], balancers = buf[1];
    Balancer[] network;
    foreach (i; 0..balancers)
    {
        buf = readln.chomp.split.to!(int[]);
        network ~= Balancer(buf[0]-1, buf[1]-1);
    }
    solve1(cables, network).writeln;
}
string solve1(in int cables, in Balancer[] network)
{
    foreach (i; 0..cables)
    {
        try
            findUniform(cables, network, i);
        catch (FoundUniform foundUniform)
            return foundUniform.stateString;
    }
    return "-1";
}
void findUniform(in int cables, in Balancer[] network, in int dst)
{
    auto states = new State[network.length];
    auto uniformed = new bool[cables];
    uniformed[dst] = true;
    foreach_reverse (i, b; network)
    {
        if (uniformed[b.x]) // x <- y
        {
            states[i] = State.up;
            uniformed[b.y] = true;
        }
        else if (uniformed[b.y]) // x -> y
        {
            states[i] = State.down;
            uniformed[b.x] = true;
        }
    }
    if (uniformed.all)
        throw new FoundUniform(states);
}
enum State
{
    up, down
}
class FoundUniform : Exception
{
    State[] state;
    this (State[] state)
    {
        super ("found!");
        this.state = state;
    }
    string stateString() const
    {
        return state.map!(_=>"^v"[_]).array;
    }
}
struct Balancer
{
    int x, y;
}
