#include <bits/stdc++.h>
#define ll long long
#define sz(x) (int)(x).size()
using namespace std;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//uniform_int_distribution<int>(1000,10000)(rng)

ll binpow(ll a, ll b)
{
    ll res = 1;
    while (b > 0)
    {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

ll gcd(ll a,ll b)
{
    if (b==0) return a;
    return gcd(b,a%b);
}

string to_upper(string a)
{
    for (int i=0;i<(int)a.size();++i) if (a[i]>='a' && a[i]<='z') a[i]-='a'-'A';
    return a;
}
 
string to_lower(string a)
{
    for (int i=0;i<(int)a.size();++i) if (a[i]>='A' && a[i]<='Z') a[i]+='a'-'A';
    return a;
}

bitset<20> edges[20];
int dp[(1<<20)];

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n,m,x,y;
    cin>>n>>m;
    while (m--)
    {
        cin>>x>>y;
        --x;--y;
        edges[x][y]=edges[y][x]=1;
    }
    for (int i=1;i<(1<<n);++i)
    {
        dp[i]=1;
        for (int j=0;j<n;++j)
            if (i&(1<<j))
                for (int k=j+1;k<n;++k)
                    if (i&(1<<k))
                        if (!edges[j][k])
                            dp[i]=1000000;
        for (int j=(i-1)&i;j;j=(j-1)&i)
            dp[i]=min(dp[i],dp[j]+dp[i^j]);
    }
    cout<<dp[(1<<n)-1];
    return 0;
}
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
using ll = long long;

struct Graph {
    struct Vertex { int n, c, f; };
    struct Edge { int i, n, d; };
    Graph(int n, int m) : v(n, { -1, -1, 0 }), e(m), n(n), m(0) {}
    void add_edge(int a, int b) {
        e[m] = { b, v[a].n, -1 };
        v[a].n = m;
        m++;
    }
    void dfs(int i, int c) {
        if (v[i].f) return; else v[i].f = 1;
        for (int j = v[i].n; j >= 0; j = e[j].n) {
            Edge &o = e[j];
            if (v[o.i].c != c) {
                o.d = v[o.i].c < c;
                continue;
            }
            if (e[j ^ 1].d < 0) o.d = 0;
            dfs(o.i, c);
        }
    }
    void solve() {
        for (int i = 0; i < n; i++) {
            cin >> v[i].c;
        }
        for (int i = 0; i < n; i++) {
            dfs(i, v[i].c);
        }
        for (int i = 0; i < m; i += 2) {
            //cout << e[i].d << ' ' << e[i + 1].d << endl;
            if (e[i].d < 0) e[i].d = e[i + 1].d ^ 1;
            cout << (e[i].d ? "->" : "<-") << '\n';
        }
    }
    vector<Vertex> v;
    vector<Edge> e;
    int n, m;
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, m;
    cin >> n >> m;

    Graph g(n, m * 2);
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        a--; b--;

        g.add_edge(a, b);
        g.add_edge(b, a);
    }

    g.solve();

    return 0;
}