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.*;
import java.io.PrintWriter;
import java.util.*;
import java.io.InputStream;
import java.io.DataInputStream;
 
 
public class Main{ 
     static HashSet hs[]=new HashSet[100010];
    static boolean visited[]=new boolean[100010];
     static int a[]=new int[100010];
     static int clr[]=new int[100010];
   static ArrayList arr[]=new ArrayList[100010];
  public static void main(String[] args) throws IOException
    {InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader scn = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
       // TreeMap<Character,Integer> h=new TreeMap<Character,Integer>();
       int n=scn.ni();
       int m=scn.ni();
      
      // int a[]=new int[n+1];
      ArrayList<Integer> arrl=new ArrayList<Integer>();
       for (int i=1;i<=n;i++){ int qwe=scn.ni(); a[i]=qwe; arrl.add(qwe); }
       
       for (int i=1;i<100010;i++) {arr[i]=new ArrayList<Integer>(); hs[i]=new HashSet<Integer>();}
       
       
       
       for (int i=1;i<=m;i++)
       { 
           
           int temp1=scn.ni();
           int temp2=scn.ni();
           arr[temp1].add(temp2);
            arr[temp2].add(temp1);
           
           
           
           
        }  
        bfs(1);
        for (int i=1;i<=n;i++) 
        { if (visited[i]==false)
            bfs(i);
        
        
        
        }
        
        int max=-11111;
        int cnt=-11111;
          for (int i=0;i<arrl.size();i++)
          {
          
             int temp=arrl.get(i);
            //  out.println(hs[temp]+" ");
              if (hs[temp].size()>=max)
             {  if (hs[temp].size()==max) cnt=temp<cnt?temp:cnt ;
              else cnt=temp; 
            max=hs[temp].size();
             
            }
              
          
            
          }
        out.println(cnt);
    
           out.close();
     } 
     
    static void bfs(int src)
     {
      Queue<Integer> q=new LinkedList<Integer>();
       q.add(src);
       visited[src]=true;
       while(!q.isEmpty())
         {
            int temp=q.remove();
            //System.out.println(temp);
            if (!arr[temp].isEmpty())
             {
                for(int i=0;i<arr[temp].size();i++)
              {
                int ele= (int)(arr[temp].get(i));
                if (a[temp]!=a[ele])
                   {// clr[a[temp]]++; 
                    hs[a[temp]].add(a[ele]);
                    }
                
                
                 if (visited[ele]==false)
                   {
                     visited[ele]=true;
                    
                     q.add(ele);
                     
                    }
     
               }
              
            }
            
           
          }
    }
     
     
     
     
   }       
  class num //implements Comparator<num>
    {
        
        public int start;
        public int end;
        num()
        {
            
        }
        num(int x,int y)
        {
            this.start = x;
            this.end =y;
        }
        public int getstart()
        {
        return start;
        }
        public int getend()
        {
        return end;
        }
    /*    public boolean equals(Object n1)
        {num n=(num)n1;
        if (this.start==n.start && this.end==n.end) return true;
        else return false;
            
            
        }
        
        
         public int hashCode() 
         {
        final int prime = 31;
        int result = 1;
        result = prime * result
                + start;
        result = prime * result+end;
               
        return result;
       }
       
       
        
       public int compare(num o1, num o2) {
              if (o1.getstart() > o2.getstart())
            return (o1.getstart()-o2.getstart());
            else if (o1.getstart() == o2.getstart())
            return (o1.getend()-o2.getend());
            else 
            return (o1.getstart()-o2.getstart());
            
        }
      */  
        
        
    }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
class FastReader
{
 
    public InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;
 
    public FastReader(InputStream stream)
    {
        this.stream = stream;
    }
 
    public int read()
    {
        if (numChars == -1)
        {
            throw new InputMismatchException ();
        }
        if (curChar >= numChars)
        {
            curChar = 0;
            try
            {
                numChars = stream.read (buf);
            } catch (IOException e)
            {
                throw new InputMismatchException ();
            }
            if (numChars <= 0)
            {
                return -1;
            }
        }
        return buf[curChar++];
    }
    
 public char nc()
    {
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        return (char) c;
    }
    
    public int ni()
    {
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        int sgn = 1;
        if (c == '-')
        {
            sgn = -1;
            c = read ();
        }
        int res = 0;
        do
        {
            if (c < '0' || c > '9')
            {
                throw new InputMismatchException ();
            }
            res *= 10;
            res += c - '0';
            c = read ();
        } while (!isSpaceChar (c));
        return res * sgn;
    }
 
    public long nl()
    {
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        int sgn = 1;
        if (c == '-')
        {
            sgn = -1;
            c = read ();
        }
        long res = 0;
        do
        {
            if (c < '0' || c > '9')
            {
                throw new InputMismatchException ();
            }
            res *= 10;
            res += c - '0';
            c = read ();
        } while (!isSpaceChar (c));
        return res * sgn;
    }
 
    public String ns()
    {
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        StringBuilder res = new StringBuilder ();
        do
        {
            res.appendCodePoint (c);
            c = read ();
        } while (!isSpaceChar (c));
        return res.toString ();
    }
 
    public boolean isSpaceChar(int c)
    {
        if (filter != null)
        {
            return filter.isSpaceChar (c);
        }
        return isWhitespace (c);
    }
 
    public static boolean isWhitespace(int c)
    {
        return c==' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }
 
    public String next()
    {
        return ns ();
    }
 
    public interface SpaceCharFilter
    {
        public boolean isSpaceChar(int ch);
    }
}   