#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
namespace fast_IO {
	const int MAXSIZE = 1 << 25;
	char buf[MAXSIZE], *p1, *p2;
	#define getchar() (p1 == p2 && (p2 = (p1 = buf) + \
			fread(buf, 1, MAXSIZE, stdin), p1 == p2) ? EOF : *p1++)
	template <typename T>
	inline void read(T &x) {
		x = 0;
		bool sign = false;
		char ch = getchar();
		while (ch < '0' || '9' < ch) {
			sign |= ch == '-';
			ch = getchar();
		}
		while ('0' <= ch && ch <='9') {
			x = (x << 3) + (x << 1) + (ch ^ 48);
			ch = getchar();
		}
		x = sign ? -x : x;
	}
	char pbuf[MAXSIZE], *pp = pbuf;
	#define putchar(CH) putch(CH)
	inline void putch(const char &c) {
		if (pp - pbuf == MAXSIZE) {
			fwrite(pbuf, 1, MAXSIZE, stdout), pp = pbuf;
		}
		*pp++ = c;
	}
	inline void Flush() {
		fwrite(pbuf, 1, pp - pbuf, stdout);
	}
	template <typename T>
	inline void print(T x) {
		static char outp[128];
		int tot = 0;
		if (!x) {
			putchar('0');
			return;
		} else if (x < 0) {
			x = -x;
			putchar('-');
		}
		while (x) { outp[tot++] = x % 10, x /= 10; }
		while (tot) { putchar(outp[--tot] + 48); }
	}
	inline void putstr(const string & s) {
		for (auto & ch : s) putchar(ch);
	}
	#undef getchar
	#undef putchar
}
using fast_IO :: read;
using fast_IO :: print;
using fast_IO :: Flush;
using fast_IO :: putch;
using fast_IO :: putstr;
#define read2(x, y) read(x), read(y)
#define read3(x, y, z) read2(x, y), read(z);
typedef vector<int> vi;
typedef long long lint;
typedef unsigned int uint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
typedef unsigned long long ulint;
#define endl '\n'
#define fst first
#define sed second
#define pb push_back
#define mp make_pair
#define rint register int
#define SZ(x) (int((x).size()))
#define all(x) (x).begin(), (x).end()
#define reveal(x) cerr << #x << " = " << (x) << endl
#define rep(it, f, e) for (rint it = (f); it <= (e); ++it)
#define per(it, f, e) for (rint it = (f); it >= (e); --it)
#define repe(it, x) for (auto it = (x).begin(); it != (x).end(); ++it)
const int MAXN = 50005;
int n, m, T; 
namespace Solve1 {
	string res;
	bool f[MAXN];
	vector<pii> edge;
	bitset<MAXN> dp[MAXN], cur;
	inline void solve() {
		rep (i, 1, n) {
			dp[i].set(i);
		}
		rep (i, 1, m) {
			int u, v;
			read2(u, v);
			edge.emplace_back(u, v);
		}
		reverse(all(edge));
		for (auto e : edge) {
			int u = e.fst, v = e.sed;
			dp[v] = (dp[u] |= dp[v]);
		}
		cur.set();
		rep (i, 1, n) {
			cur &= dp[i];
		}
		if (cur.none()) {
			putstr("-1\n");
			Flush();
			return;
		}
		int ter = 0;
		rep (i, 1, n) {
			if (cur.test(i)) {
				ter = i;
				break;
			}
		}
		f[ter] = true;
		for (auto e : edge) {
			int u = e.fst, v = e.sed;
			if (f[u]) {
				f[v] = f[u];
				res += '^';
			} else {
				f[u] = f[v];
				res += 'v';
			}
		}
		reverse(all(res));
		putstr(res + "\n");
		Flush();
	}
}
namespace Solve2 {
	string res;
	bool dp[MAXN * 2][2][2][2];
	vector<tuple<int, int, int> > edge;
	tuple<int, bool, bool, bool, bool> tr[MAXN * 2][2][2][2];
	inline void solve() {
		res.resize(m, '^');
		rep (i, 1, m) {
			int u, v;
			read2(u, v);
			if (v <= 3) {
				edge.emplace_back(i, u, v);
			}
		}
		if (n == 2) {
			putstr("-1\n");
			Flush();
			return;
		}
		dp[0][1][1][1] = 1;
		rep (i, 0, SZ(edge) - 1) rep (s1, 0, 1) {
			rep (s2, 0, 1) rep (s3, 0, 1) if (dp[i][s1][s2][s3]) {
				int u = get<1>(edge[i]) - 1;
				int v = get<2>(edge[i]) - 1;
				int n1 = s1, n2 = s2, n3 = s3, *a, *b;
				if (u == 0 && v == 1) a = &n1, b = &n2;
				else if (u == 0 && v == 2) a = &n1, b = &n3;
				else a = &n2, b = &n3;
				if (*a == 0 && *b == 0) {
					dp[i + 1][n1][n2][n3] = true;
					tr[i + 1][n1][n2][n3] = make_tuple(i, n1, n2, n3, 0);
				} else {
					*a = 1, *b = 0;
					dp[i + 1][n1][n2][n3] = true;
					tr[i + 1][n1][n2][n3] = make_tuple(i, s1, s2, s3, 0);
					*a = 0, *b = 1;
					dp[i + 1][n1][n2][n3] = true;
					tr[i + 1][n1][n2][n3] = make_tuple(i, s1, s2, s3, 1);
				}
			}
		}
		rep (s1, 0, 1) rep (s2, 0, 1) {
			rep (s3, 0, 1) if (dp[SZ(edge)][s1][s2][s3]) {
				if (s1 + s2 + s3 < 2) continue;
				int i = SZ(edge);
				while (i) {
					res[get<0>(edge[i - 1]) - 1] = get<4>(tr[i][s1][s2][s3]) ? 'v' : '^';
					tie(i, s1, s2, s3, ignore) = tr[i][s1][s2][s3];
				}
				putstr(res + "\n");
				Flush();
				return;
			}
		}
	}
}
int main() {
	read3(n, m, T);
	if (T == 1) Solve1 :: solve();
	if (T == 2) Solve2 :: solve();
	return 0;
}

Measured memory_bytes: 312692