One day Petya got a birthday present from his mom: a book called "The Legends and Myths of Graph Theory". From this book Petya learned about a hydra graph.

A non-oriented graph is a hydra, if it has a structure, shown on the figure below. Namely, there are two nodes *u* and *v* connected by an edge, they are the hydra's chest and stomach, correspondingly. The chest is connected with *h* nodes, which are the hydra's heads. The stomach is connected with *t* nodes, which are the hydra's tails. Note that the hydra is a tree, consisting of *h* + *t* + 2 nodes.

Also, Petya's got a non-directed graph *G*, consisting of *n* nodes and *m* edges. Petya got this graph as a last year birthday present from his mom. Graph *G* contains no self-loops or multiple edges.

Now Petya wants to find a hydra in graph *G*. Or else, to make sure that the graph doesn't have a hydra.
The first line contains four integers *n*, *m*, *h*, *t* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">5</sup>, 1 ≤ *h*, *t* ≤ 100) — the number of nodes and edges in graph *G*, and the number of a hydra's heads and tails.

Next *m* lines contain the description of the edges of graph *G*. The *i*-th of these lines contains two integers *a*<sub class="lower-index">*i*</sub> and *b*<sub class="lower-index">*i*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub>, *b*<sub class="lower-index">*i*</sub> ≤ *n*, *a* ≠ *b*) — the numbers of the nodes, connected by the *i*-th edge.

It is guaranteed that graph *G* contains no self-loops and multiple edges. Consider the nodes of graph *G* numbered with integers from 1 to *n*.
graph = []
visited = [] 
head = []
tail = [] 
n,m,h,t,i = 0,0,0,0,0

def vertexcommun (u,v):
    count = 0 
    for i in range (len(graph[u])):
        a = graph[u][i]
        if a == v : continue 
        visited[a] = True 
    for i in range(len(graph[v])):
        a = graph[v][i]
        if visited[a]:
            count = count +1 
    return count 

def restorevisitedarray (u):
    for i in range (len(graph[u])):
        a = graph[u][i]
        visited [a] = False

def solution (u,v):
    deg_u = len (graph[u])
    deg_v = len (graph[v])
    

    if deg_u < h+1 or deg_v < t+1:
        return False 

    if deg_u >= h+t+1:
        for i in range (deg_v):
            if len(tail) == t : break 
            a = graph[v][i]
            if a == u : continue 
            visited[a] = True 
            tail.append(a)
        for i in range(deg_u):
            if len(head) == h : break
            a = graph[u][i]
            if a == v  or visited[a]: continue 
            head.append(a)
        return True

    if deg_v > h+t+1:
        for i in range (deg_u):
            if len(head) == h :break
            a = graph[u][i]
            visited[a]= True 
            head.append(a)
        for i in range(deg_v):
            if len(tail) == t : break
            a= graph[v][i]
            if a == u or visited[a] : continue
            tail.append(a)
        return True 
        
    communvertex = vertexcommun(u,v)
    ind_u = deg_u -1 - communvertex
    ind_v = deg_v -1 - communvertex

    if h - ind_u + t - ind_v > communvertex:
        restorevisitedarray(u)
        return False 

    countcommun = 0 
    for i in range (deg_v):
        if len(tail) == t : break 
        a = graph[v][i]
        if visited[a] and countcommun < t - ind_v:
            countcommun = countcommun + 1
            visited[a] = False 
            tail.append(a)
        elif visited[a] == False and a != u :
            tail.append(a)
    for i in range (deg_u):
        if len(head)==h : break 
        a = graph[u][i]
        if not visited[a] : continue 
        head.append(a)  
    return True 



def init (n):
    i =0 ; 
    while i < n:
        graph.append([])
        visited.append(False)
        i= i+1  

def printsolution (u,v):
    print("YES")
    print (str(u+1) + " " + str(v+1))
    for item in head:
        print (str (item+1) , end = ' ')
    print()
    for item in tail:
        print(str(item+1),end = ' ')
    print()



def printgraph ():
    i=0 
    for listady in graph:
        print (str (i) + str(listady))
        i = i+1 

if __name__ == '__main__':
    
    line = input().split()
    n = int(line[0])
    m = int(line[1])
    h = int(line[2])
    t = int(line[3])

    edges = [] 

    #print ( str(n) + " " + str(m) + " " + str(h) + " " + str(t))
    init(n)

    while i < m:
        line = input().split()
        a , b = int (line[0]) , int (line[1])
        edges.append((a-1,b-1))   
        graph[a-1].append(b-1)
        graph[b-1].append(a-1)  
        i = i+1 
    
    flag = False
    for item in edges :
        u , v = item[0] , item [1]

        if solution(u,v):
            printsolution(u,v)
            flag = True
            break 
        elif solution(v,u):
            printsolution(v,u)
            flag = True
            break 

    if not flag : 
        print("NO")

        

    
