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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;


public class  zz{
	static long[][]memo;
	static long mod=(long)(1e9)+7;
	static long dp(int nottaken,int val) {
		if(nottaken==0 && val!=0)return 1l;
		if(nottaken==0)return 0l;
		if(memo[nottaken][val]!=-1)return memo[nottaken][val];
		long sum=0;
		for(int j=1;j<=nottaken;j++) {
			sum=(sum+dp(nottaken-j,val^j))%mod;
		}
		return memo[nottaken][val]=sum;
	}
	static int o=0;
		static class ft {
			int[][]tree;
			int max_x;int max_y;
			ft(int x,int y){
				tree=new int[x+1][y+1];
				max_x=x;max_y=y;
			}
			void update(int x , int y , int val){
				int y1;
			    while (x <= max_x){
			        y1 = y;
			        while (y1 <= max_y){
			            tree[x][y1] += val;
			            y1 += (y1 & -y1); 
			        }
			        x += (x & -x); 
			    }
			}
			int read(int x,int y){
				int sum = 0; 
				  
				int y1;
			    while (x >0){
			        y1 = y;
			        while (y1 >0){
			            sum+=tree[x][y1];
			            y1 -= (y1 & -y1); 
			        }
			        x -= (x & -x); 
			    }
			    return sum;
			}
			
			int sum(int lx,int rx,int ly,int ry) {
				return read(rx,ry)-read(rx,ly-1)-read(lx-1,ry)+read(lx-1,ly-1);
			}
			
			
	}
		static boolean []v;
		static void bfs(int i) {
			v[i]=true;
			if(d[c[i]]==null)
			d[c[i]]=new HashSet<Integer>();
			for(int j:adj[i]) {
				if(!v[j]) {
					bfs(j);
				}
				if(c[i]!=c[j])
				d[c[i]].add(c[j]);
			}
		}
		static int[]c;
		static HashSet<Integer>[]d;
    public static void main(String[] args) throws IOException{
        MScanner sc = new MScanner(System.in);
        PrintWriter pw=new PrintWriter(System.out);
        	int n=sc.nextInt();
        	int m=sc.nextInt();
        	adj=new LinkedList[n];
        	v=new boolean[n];
        	c=new int[n];d=new HashSet[(int)(1e5)+1];
        	for(int i=0;i<n;i++) {
        		c[i]=sc.nextInt();
        		adj[i]=new LinkedList<Integer>();
        	}
        	for(int i=0;i<m;i++) {
        		int x=sc.nextInt()-1;int y=sc.nextInt()-1;
        		adj[x].add(y);adj[y].add(x);
        		
        	}
        for(int i=0;i<n;i++) {
        	if(!v[i])bfs(i);
        }
        int max=-1;int maxc=-1;
        for(int i=1;i<=1e5;i++) {
        	//System.out.println(d[i]);
        	if(d[i]!=null && d[i].size()>max) {
       			max=d[i].size();maxc=i;
        		
        	}
        }
        pw.println(maxc);
        pw.flush();
    }
    static LinkedList<Integer>adj[];
    static long fastpow(long n,long ti) {
		 if (ti == 0) 
		        return 1l;
		if(ti%2==0) {
			long y=fastpow(n, ti/2);
			long k=y*y;
			k%=mod;
			return k;
		}
		else {
			long y=fastpow(n, ti/2);
			long k=n*y*y;
			k%=mod;
			return k;
		}
	}
    static long gcd(long a, long b) {

		if (b == 0)
			return a;
		return gcd(b, a % b);
	}
    static int[]primes;
    static int sizeofp=0;
	static int[] isComposite;

	static void sieve(int N)	// O(N log log N) 
	{
		isComposite = new int[N+1];					
		isComposite[0] = isComposite[1] = 1;			
		primes = new int[N];

		for (int i = 2; i <= N; ++i) 					
			if (isComposite[i] == 0) 					
			{
				primes[sizeofp++]=i;;
				if(1l * i * i <= N)
					for (int j = i * i; j <= N; j += i)	
						isComposite[j] = 1;
			}   
	}
    static class pair implements Comparable<pair>{
    	int num;int idx;
    	pair(int x,int y){
    		num=x;idx=y;
    	}
		@Override
		public int compareTo(pair o) {
			if(num!=o.num) {
				return num-o.num;
			}
			return idx-o.idx;
		}
		public boolean equals(pair o) {
			if(this.compareTo(o)==0)return true;
			return false;
		}
		public String toString() {
			return "("+0+" "+0+")";
		}
    }
	static class MScanner 
	{
	    StringTokenizer st;
	    BufferedReader br;

	    public MScanner(InputStream s){    br = new BufferedReader(new InputStreamReader(s));}

	    public String next() throws IOException 
	    {
	        while (st == null || !st.hasMoreTokens()) 
	            st = new StringTokenizer(br.readLine());
	        return st.nextToken();
	    }

	    public int nextInt() throws IOException {return Integer.parseInt(next());}
	    
	    public long nextLong() throws IOException {return Long.parseLong(next());}

	    public String nextLine() throws IOException {return br.readLine();}
	    
	    public double nextDouble() throws IOException
	    {
	        String x = next();
	        StringBuilder sb = new StringBuilder("0");
	        double res = 0, f = 1;
	        boolean dec = false, neg = false;
	        int start = 0;
	        if(x.charAt(0) == '-')
	        {
	            neg = true;
	            start++;
	        }
	        for(int i = start; i < x.length(); i++)
	            if(x.charAt(i) == '.')
	            {
	                res = Long.parseLong(sb.toString());
	                sb = new StringBuilder("0");
	                dec = true;
	            }
	            else
	            {
	                sb.append(x.charAt(i));
	                if(dec)
	                    f *= 10;
	            }
	        res += Long.parseLong(sb.toString()) / f;
	        return res * (neg?-1:1);
	    }
	    
	    public boolean ready() throws IOException {return br.ready();}


	}
}