You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of the i-th vertex is an integer ci.

Let's consider all vertices of the graph, that are painted some color k. Let's denote a set of such as V(k). Let's denote the value of the neighbouring color diversity for color k as the cardinality of the set Q(k) = {cu : cu ≠ k and there is vertex v belonging to set V(k) such that nodes v and u are connected by an edge of the graph}.

Your task is to find such color k, which makes the cardinality of set Q(k) maximum. In other words, you want to find the color that has the most diverse neighbours. Please note, that you want to find such color k, that the graph has at least one vertex with such color.

Input

The first line contains two space-separated integers n, m (1 ≤ n, m ≤ 105) — the number of vertices end edges of the graph, correspondingly. The second line contains a sequence of integers c1, c2, ..., cn (1 ≤ ci ≤ 105) — the colors of the graph vertices. The numbers on the line are separated by spaces.

Next m lines contain the description of the edges: the i-th line contains two space-separated integers ai, bi (1 ≤ ai, bi ≤ n; ai ≠ bi) — the numbers of the vertices, connected by the i-th edge. 

It is guaranteed that the given graph has no self-loops or multiple edges.

Output

Print the number of the color which has the set of neighbours with the maximum cardinality. It there are multiple optimal colors, print the color with the minimum number. Please note, that you want to find such color, that the graph has at least one vertex with such color.

Examples

Input

6 6
1 1 2 3 5 8
1 2
3 2
1 4
4 3
4 5
4 6


Output

3


Input

5 6
4 2 5 2 4
1 2
2 3
3 1
5 3
5 4
3 4


Output

2
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long int INF = 1e17;
long long int power(long long int x, long long int y) {
  long long int t = 1;
  while (y > 0) {
    if (y % 2)
      y -= 1, t = t * x % mod;
    else
      y /= 2, x = x * x % mod;
  }
  return t;
}
long long int inverse(long long int q) {
  long long int t;
  t = power(q, mod - 2);
  return t;
}
bool cmp(pair<long long int, long long int> p1,
         pair<long long int, long long int> p2) {
  if (p1.second > p2.second) {
    return true;
  } else if (p1.second == p2.second) {
    if (p1.first < p2.first) {
      return true;
    } else {
      return false;
    }
  } else {
    return false;
  }
}
long long int col[1000001];
vector<long long int> v[1000001];
long long int vis[1000001] = {0};
set<long long int> s1[1000001];
void dfs(long long int x) {
  long long int cou = 0, i;
  for (i = 0; i < v[x].size(); i++) {
    if (col[x] != col[v[x][i]]) {
      s1[col[x]].insert(col[v[x][i]]);
      s1[col[v[x][i]]].insert(col[x]);
    }
  }
}
int main() {
  long long int n, m, i, j, k, l, x, y;
  cin >> n >> m;
  long long int ans = INT_MAX, mex = 0;
  for (i = 1; i < n + 1; i++) {
    cin >> col[i];
    ans = min(ans, col[i]);
  }
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (i = 1; i <= n; i++) {
    dfs(i);
  }
  long long int res = 0;
  for (i = 1; i <= 1000000; i++) {
    if (s1[i].size() > res) {
      res = s1[i].size();
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
