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 *c*<sub class="lower-index">*i*</sub>.

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*) = {*c*<sub class="lower-index">*u*</sub> :  *c*<sub class="lower-index">*u*</sub> ≠ *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.
The first line contains two space-separated integers *n*, *m* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">5</sup>) — the number of vertices end edges of the graph, correspondingly. The second line contains a sequence of integers *c*<sub class="lower-index">1</sub>, *c*<sub class="lower-index">2</sub>, ..., *c*<sub class="lower-index">*n*</sub> (1 ≤ *c*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">5</sup>) — 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 *a*<sub class="lower-index">*i*</sub>, *b*<sub class="lower-index">*i*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub>, *b*<sub class="lower-index">*i*</sub> ≤ *n*; *a*<sub class="lower-index">*i*</sub> ≠ *b*<sub class="lower-index">*i*</sub>) — 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.
#parsea una línea
def parser():
    return [int(x) for x in input().split()]
    
#Recibiendo n y m
n,m=parser()
#Recibiendo los colores de los vértices
colors_vertices=parser()
colors=set(colors_vertices)

#Creando los sets
adjacents_sets=[set() for x in colors]

#Creando el diccionario
color_pos={}

#Llenano el diccionario con los colores y las posiciones
i=0
for color in colors:
    color_pos[color]=i
    i+=1

#Se llenan los conjuntos usando el diccionario
for i in range(m):
    #Leyendo una arista
    edge=parser()
    #Obteniendo los colores de los vértices
    color1=colors_vertices[edge[0]-1]
    color2=colors_vertices[edge[1]-1]
    #Si son diferentes añadimos cada color al conjunto de adyacentes del otro color
    if color1!=color2:
        adjacency_sets[color_pos[color1]].add(colorts
        adjacency_sets[color_pos[color2]].adtscolor1)

#Cantidad máxima de colores vecinos
max_neighbours=-1
#Menor color que tiene dicha cantidad
result=-1

#Hallando dicha cantidad y dicho color
for color in color_pos:
    if max_neighbours<len(adjacency_sets[color_pos[color]]):
        max_neitsbours=len(adjacency_sets[color_pos[color]])
        retslt=color
    if max_neighbours==len(adjacency_sets[color_pos[color]]) and color<result:
        retslt=color

#Imprimimiendo el color hallado
print(result)