#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int, int>
#define pll pair<long long,long long>
#define vl vector<long long>
#define vll vector<pll>
#define vi vector<int>
#define vii vector<pii>
#define sws ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define tcase int tt; cin>>tt; while(tt--)
#define tcase2 int tt; cin>>tt; for(int qq=1;qq<=tt;qq++)
using namespace std;
typedef long long int ll;
typedef  unsigned long long int ull;
typedef long double ld;
const int MAXN = 1000002;
const int MOD2 = 998244353;
const int MOD = 1000000007; 
const int INF = 1e8;
const ld EPS = 1e-7;
// Extra
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define trav(a, x) for(auto& a : x)
#define fill(x,y) memset(x,y,sizeof(x))
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
ll mul(ll x, ll y)
{
    return (x * 1ll * y) % MOD;
}
 
ll fastpow(ll x, ll y)
{
    ll z = 1;
    while(y)
    {
        if(y & 1) z = mul(z, x);
        x = mul(x, x);
        y >>= 1;
    }
    return z;
}
ll modinv(ll n,ll p)
{
	return fastpow(n,p-2) ;
}
struct Comp {
  bool operator()(const std::pair<int, int> &a, const std::pair<int, int> &b) {
    if (a.first != b.first) {
      return a.first > b.first;
    }
    return a.second >b.second;
  }
};


int main(int argc, char** argv)
{   sws ;
  cout<<setprecision(10);
  
//  ll google=0 ;
  
 // tcase
    { 
    ll a,b,c ;
    cin>>a>>b>>c; 
    if(a<=0&&b<=0)
    {   a*=-1 ;
        b*=-1;
    	if(c%2)
    	{
    		if(a==b)
    		cout<<"=" ;
    		else if(a>b)
    		cout<<"<" ;
    		else
    		cout<<">" ;
		}
		else
		{
				if(a==b)
    		cout<<"=" ;
    		else if(a>b)
    		cout<<">" ;
    		else
    		cout<<"<" ;
		}
	}
	else if(a>=0&&b>=0)
	{
			if(a==b)
    		cout<<"=" ;
    		else if(a>b)
    		cout<<">" ;
    		else
    		cout<<"<" ;
	}
	else if(a>=0&&b<=0)
	{
		if(c%2)
		cout<<">" ;
		else
		{
			b*=-1 ;
				if(a==b)
    		cout<<"=" ;
    		else if(a>b)
    		cout<<">" ;
    		else
    		cout<<"<" ;
		}
	}
	else
	{
			if(c%2)
		cout<<"<" ;
		else
		{
			a*=-1 ;
				if(a==b)
    		cout<<"=" ;
    		else if(a>b)
    		cout<<">" ;
    		else
    		cout<<"<" ;
		}
	}
    }
	
return 0 ;
}
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<complex>
#include<cstdio>
#define initdp(a,b) for(int i=0;i<=a;i++)for(int j=0;j<=b;j++)dp[i][j]=-1;
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ppi pair<pii,int>
#define pip pair<int,pii>
#define ll long long
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define inf 1000000001
#define inf1 1000000000000000001
#define mod 1000000007
#define pie 3.14159265358979323846
#define N 100005
#define mid(l,r) l+(r-l)/2
#define removeduplicates(vec) vec.erase( unique( vec.begin(), vec.end() ), vec.end() )
#define memset1(v) memset(v,-1,sizeof(v))
#define memset0(v) memset(v,0,sizeof(v))
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
void mad(ll &a,ll b){a=(a+b)%mod;if(a<0)a+=mod;}
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}
int n,m;
vector<pii>ed[2005];
void solve(){
	cin>>n>>m;
	rep(i,m){
		int u,v,c;
		cin>>u>>v>>c;
		ed[u].pb(pii(v,c));
	}
	for(int i=1;i<=n;i++){
		int d[n+1];
		for(int i=1;i<=n;i++)d[i]=inf;
		priority_queue<pii>pq;
		for(pii p:ed[i]){
			pq.push(pii(-p.se,p.fi));
			d[p.fi]=min(d[p.fi],p.se);
		}
		while(!pq.empty()){
			pii p=pq.top();
			int u=p.se;
			int d1=-p.fi;
			pq.pop();
			if(d1>d[u])continue;
			for(pii p:ed[u]){
				if(d[p.fi]>d1+p.se){
					d[p.fi]=d1+p.se;
					pq.push(pii(-d[p.fi],p.fi));
				}
			}
		}
		if(d[i]>=inf)cout<<-1<<"\n";
		else cout<<d[i]<<"\n";
	}
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t=1;
	//cin>>t;
	while(t--){
		solve();
	}
}