#include<bits/stdc++.h>
using namespace std;
const int p = 31;
const int m = 1e9 + 7;
typedef long long ll;
typedef int in;
#define ff first
#define ss second
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define pb push_back
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

const int N = 1e2 + 10, M = N * N;

int seen[N];
vector<pii> g[N];
vector<int>type(M, -1);

void dfs(int u, int par, vector<pii>& edges) {
    seen[u] = 1;
    for (auto& [v, e] : g[u]) {
        if (v == par or seen[v] == 2) {
            continue;
        }
        if (seen[v]) {
            if (edges[e].first == u) {
                type[e] = 2;
            }
            else {
                type[e] = 1;
            }
        }
        else {
            if (edges[e].first == u) {
                type[e] = 2;
            }
            else {
                type[e] = 1;
            }
            dfs(v, u, edges);
        }
    }
    seen[u] = 2;
}

int main() {
    int n, m;
    cin >> n >> m;
    vector<pii> edges(m);
    for (auto& [a, b] : edges) {
        cin >> a >> b;
        --a; --b;
    }
    vector<int> c(n);
    for (auto& i : c) {
        cin >> i;
    }
    for (int i = 0; i < m; ++i) {
        int a = edges[i].first, b = edges[i].second;
        if (c[a] == c[b]) {
            g[a].pb({b, i});
            g[b].pb({a, i});
            continue;
        }
        if (c[a] < c[b])type[i] = 1;
        else
            type[i] = 2;
    }
    for (int i = 0; i < n; ++i) {
        if (!seen[i]) {
            dfs(i, -1, edges);
        }
    }
    for (int i = 0; i < m; ++i) {
        if (type[i] == 1) {
            cout << "<-\n";
        } else {
            cout << "->\n";
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<(int)(n);i++)
int main()
{
    int n,x;
    cin >> n >> x;
    vector<int> a(n), b(n);
    int i = 0;
    rep(i,n){
        cin >> a[i];
        if(a[i] != x)
        {
            b[i] = a[i];
            cout << b[i] << " ";
        }
    } 
    

    return 0;
    
}