Devu being a small kid, likes to play a lot, but he only likes to play with arrays. While playing he came up with an interesting question which he could not solve, can you please solve it for him?

Given an array consisting of distinct integers. Is it possible to partition the whole array into *k* disjoint non-empty parts such that *p* of the parts have even sum (each of them must have even sum) and remaining *k* - *p* have odd sum? (note that parts need not to be continuous).

If it is possible to partition the array, also give any possible way of valid partitioning.
The first line will contain three space separated integers *n*, *k*, *p* (1 ≤ *k* ≤ *n* ≤ 10<sup class="upper-index">5</sup>; 0 ≤ *p* ≤ *k*). The next line will contain *n* space-separated distinct integers representing the content of array *a*: *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>).
import sys
def devu_and_partitionong_of_the_array(n,k,p,a):
    Even=[]#lista con elementos pares de a
    Odd=[]#lista con elementos impares de a
    Sets=[[] for i in range(k)]# lista que contiene los k subconjuntos disjuntos

    #se recorre el arreglo
    for j in range(n):
        #si el elemento es par, se agrega a Even, en caso contrario, es impar, por tanto se agrega a Odd
        if a[j]%2==0:
            Even.append(a[j])
        else:
            Odd.append(a[j])

    #son los incisos a),b) y d) demostrados en el informe, en estos casos no es posible crear k subconjuntos que cumplan las condiciones establecidas
    if (len(Odd)< (k-p)) or ((len(Odd)-(k-p))%2 !=0) or ((len(Odd)-(k-p))/2 + len(Even))<p:
        print("NO\n")
    else:
        #se pueden crear los subconjuntos
        for i in range(k-p):
            #k-p primeros subconjuntos tienen un entero par
            Sets[i].append(Odd.pop())

        for i in range(k-p,k):
            #p últimos subconjuntos, tienen un entero par
            if len(Even) != 0:
                Sets[i].append(Even.pop())
            # o dos enteros impares
            elif len(Odd) != 0:
                Sets[i].append(Odd.pop())
                Sets[i].append(Odd.pop())

        #los elementos que quedan, se ponen en el primer subconjunto
        while len(Even) != 0:
            Sets[0].append(Even.pop())
        while len(Odd) != 0:
            Sets[0].append(Odd.pop())

        print("YES\n")
        #se imprimen el tamaño del subconjunto y los elementos que contiene
        for l in range(k):
           size=len(Sets[l])
           sys.stdout.write(str(size))
           for m in range(size):
              sys.stdout.write(" " + str(Sets[l][m]))
           print("\n")

line1=list(map(int,input().split()))
line2=list(map(int,input().split()))

devu_and_partitionong_of_the_array(line1[0],line1[1],line1[2],line2)








