#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define ull unsigned ll
#define uint unsigned int
#define db double
#define pint pair<int,int>
#define mk make_pair
#define pb push_back
#define eb emplace_back
#define ins insert
#define fi first
#define se second
#define Rep(x,y,z) for(int x=(y);x<=(z);x++)
#define Red(x,y,z) for(int x=(y);x>=(z);x--)
using namespace std;
const int MAXN=100005;
char buf[1<<12],*pp1=buf,*pp2=buf,nc;int ny;
inline char gc() {return pp1==pp2&&(pp2=(pp1=buf)+fread(buf,1,1<<12,stdin),pp1==pp2)?EOF:*pp1++;}
//inline char gc(){return getchar();}
inline int read(){
	int x=0;for(ny=1;nc=gc(),(nc<48||nc>57)&&nc!=EOF;)if(nc==45)ny=-1;if(nc<0)return nc;
	for(x=nc-48;nc=gc(),47<nc&&nc<58&&nc!=EOF;x=(x<<3)+(x<<1)+(nc^48));return x*ny;
}
int n,m,a[MAXN],b[MAXN],c[MAXN],vis[MAXN],ans[MAXN];
vector<int>G[MAXN];
void dfs(int x){
	vis[x]=1;
	for(auto o:G[x]){
		int y=a[o]+b[o]-x;
		if(~ans[o])continue;
		ans[o]=(y==a[o]);
		if(vis[y])continue;
		dfs(y);
	}
}
int main(){
//	freopen("std.in","r",stdin);
//	freopen("std.out","w",stdout);
	n=read(),m=read(),memset(ans,-1,sizeof(ans));
	Rep(i,1,m)a[i]=read(),b[i]=read();
	Rep(i,1,n)c[i]=read();
	Rep(i,1,m)if(c[a[i]]==c[b[i]])
		G[a[i]].pb(i),G[b[i]].pb(i);
	Rep(i,1,n)if(!vis[i])dfs(i);
	Rep(i,1,m){
		if(c[a[i]]==c[b[i]])puts(ans[i]?"<-":"->");
		else puts(c[a[i]]<c[b[i]]?"<-":"->");
	}
	return 0;
}




#include <bits/stdc++.h>
using namespace std;

#define rep(type, val, n) for(type val = 0; val < n; ++val)
#define repi(type, val, init, end) for(type val = init; val < end; ++val)

using Int = long long;
using uInt = unsigned long long;

int main() {
    uInt n, ans[100005] = { 0 };
    cin >> n;
    
    rep (int, i, n + 1) ans[i] = 1;
    repi(int, i, 2, n + 1) {
        if (ans[i] == 1) {
            for (uInt check_pow = i; check_pow < n + 1; check_pow *= i) 
                for (uInt add_i = check_pow << (check_pow == i ? 1 : 0); add_i < n + 1; add_i += check_pow) {
                    ans[add_i]++;
                }
            
            ans[i]++;
        }
        else {}
    }
    repi (int, i, 1, n)
        cout << ans[i] << " ";
    cout << ans[n] << endl;
        
    return 0;
}