Harryxun/stf_run huggingface dataset:
n, m = map(int, input().split())
sc = [map(int, input().split()) for i in range(m)]
s, c = [list(i) for i in zip(*sc)]

for i in range (10**(n-1)+1,10**n):
    p = str(i)
    flag = 0
    for j in range(m):
        if p[s[j]-1] != str(c[j]):
            flag = 1
            break

    if flag == 0:
        print(i)
        flag = 2
        break

if flag != 2:
    print("-1")

### FIXED CODE ###

n, m = map(int, input().split())
sc = [map(int, input().split()) for i in range(m)]

flag = 0

if m != 0:
    s, c = [list(i) for i in zip(*sc)]


    if n == 1:
        for i in range (0,10):
            p = str(i)
            flag = 0
            for j in range(m):
                if p[s[j]-1] != str(c[j]):
                    flag = 1
                    break

            if flag == 0:
                print(i)
                flag = 2
                break
    else:
        for i in range (10**(n-1),10**n):
            p = str(i)
            flag = 0
            for j in range(m):
                if p[s[j]-1] != str(c[j]):
                    flag = 1
                    break

            if flag == 0:
                print(i)
                flag = 2
                break

if flag != 2:
    if m == 0:
        if n == 1:
            print("0")
        elif n == 2:
            print("10")
        else:
            print("100")
    else:
        print("-1")
n,q=[int(i) for i in input().split()]
a1={}
a2={}
for _ in range(n-1):
  x,y=[int(i)-1 for i in input().split()]
  if x in a1:
    a1[x].append(y)
  else:
    a1[x]=[y]
  if x in a2:
    a2[x].append(y)
  else:
    a2[x]=[y]
root=[0]*n
def c(ind=0,ro=0):
  global root
  if root[ind]!=0:
    return 0
  root[ind]=ro
  if ind in a1:
    for i in a1[ind]:
      c(i,ind)
  if ind in a2:
    for i in a2[ind]:
      c(i,ind)
c()
p=[0]*n
for _ in range(q):
  x,y=[int(i) for i in input().split()]
  p[x-1]+=y
r=[]
for i in range(n):
  j=i
  k=0
  while True:
    k+=p[j]
    if j==0 and root[j]==0:
      break
    j=root[j]
  r.append(str(k))
print(" ".join(r))

### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)


def input():
    return sys.stdin.readline()


n, q = [int(i) for i in input().split()]
ab = [[] for _ in range(n)]
for _ in range(n - 1):
    i, j = [int(i)-1 for i in input().split()]
    ab[i].append(j)
    ab[j].append(i)
p = [0]*n
for _ in range(q):
    i, j = [int(i) for i in input().split()]
    p[i-1] += j

al = [False]*n
pp = [0]*n


def a(i=0, j=0):
    al[i] = True
    j += p[i]
    pp[i] = str(j)
    for k in ab[i]:
        if not al[k]:
            a(k, j)


a()
print(" ".join(pp))
a = int(input())
b = int(input())

count=0
while a >0:
	a -= b
	count+=1
print(count)

### FIXED CODE ###


a,b=map(int, input().split())

count=0
while a >0:
	a -= b
	count+=1
print(count)
n,m = map(int, input().split())
g = [[] for i in range(n)]
for i in range(m):
  a, b = map(int, input().split())
  if not b-1 in g[a-1]:
    g[a-1].append(b-1)
  if not a-1 in g[b-1]:
    g[b-1].append(a-1)
v = [-1 for i in range(n)]
ans = [0]*n
def dfs(x,y):
  for i in g[x]:
    if v[i] == -1:
      v[i]=v[x]+1
      ans[y]+=1
      dfs(i,y)
for i in range(n):
  if v[i]!=-1:
    continue
  v[i]=0
  dfs(i,i)
print(max(ans)+1)

### FIXED CODE ###

from collections import deque
n,m = map(int, input().split())
if m == 0:
  print(1)
  exit()
g = [[] for i in range(n)]
for i in range(m):
  a, b = map(int, input().split())
  g[a-1].append(b-1)
  g[b-1].append(a-1)
v = [-1 for i in range(n)]
ans = []
for i in range(n):
  if v[i]!=-1:
    continue
  v[i]=0
  an=1
  d = deque([i])
  while len(d):
    x = d.popleft()
    for i in g[x]:
      if v[i] == -1:
        d.append(i)
        v[i]=1
        an+=1
  ans.append(an)
print(max(ans))
data = [
    "{0} {1}".format(s, r)
    for s in ('S', 'H', 'C', 'D')
    for r in range(1, 13, + 1)
    ]

count = int(input())
for c in range(count):
    card = input()
    data.remove(card)

for c in data:
    print(c)

### FIXED CODE ###

cards = {
        'S': [0 for _ in range(13)],
        'H': [0 for _ in range(13)],
        'C': [0 for _ in range(13)],
        'D': [0 for _ in range(13)],
}
n = int(input())
for _ in range(n):
    (s, r) = input().split()
    cards[s][int(r) - 1] = 1
 
for s in ('S', 'H', 'C', 'D'):
    for r in range(13):
        if cards[s][r] == 0:
            print(s, r + 1)
N = int(input())
A = sorted(list(map(int,input().split())))
M = max(A)

t = 7+10*9
if M%2 == 0:
    m = M//2
    p = 0
    for k in range(N):
        if abs(m-A[k]) < t:
            t = abs(m-A[k])
            p = k
    print(M,A[p])
else:
    m = M//2
    l = 1 + M//2
    for k in range(N):
        if abs(m-A[k]) < t:
            t = abs(m-A[k])
            p = k
        elif abs(l-A[k]) < t:
            t = abs(l-A[k])
            p = k
    print(M,A[p])



### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
p = max(A)
q = p//2
r = 10**9+7
ans = 0
for k in range(N):
    if abs(A[k]-q) < r and A[k] != p:
        r = abs(A[k]-q)
        ans = A[k]

print(p,ans)
strict = input()
str_list = strict.sprit(' ')
a = str_list[0]
b = str_list[1]

if (a > b):
	print ("a > b")
elif (a<b):
	print ("a < b")
else:
	print ("a = b")

### FIXED CODE ###

import sys
strict = raw_input()
str_list = strict.split(' ')
a = int(str_list[0])
b = int(str_list[1])

if( a > b ):
	print("a > b")
elif( a < b ):
	print("a < b")
else:
	print("a == b")
import sys

def calc(S):
    N = len(S)
    r = 0
    d = [0] * 2019
    d[0] = 1
    for i in range(N):
        r = (r + int(S[N - 1 - i]) * 10 ** i) % 2019
        d[r] += 1
    ans = 0
    for c in d:
        ans += c * (c - 1) // 2
    return ans


S = sys.stdin.readline() # input()
print(calc(S))

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline().rstrip('\n')

def calc(S):
    N = len(S)
    r = 0
    d = [0] * 2019
    p = 1
    d[0] = 1
    for i in range(N):
        r = (r + int(S[N - 1 - i]) * p) % 2019
        p = (p * 10) % 2019
        d[r] += 1
    ans = 0
    for c in d:
        ans += c * (c - 1) // 2
    return ans


S = input()
print(calc(S))
a,b,c=map(int,input().split())
print('Yes' if a <= c <= b else ''No')

### FIXED CODE ###

a,b,c=map(int,input().split())
print('Yes' if a <= c <= b else 'No')
W,H,x,y = map(int,input().split())
if y == H*x/W or y == H - H*x/W:
    print(W*H 1)
else:
    print(W*H 0)

### FIXED CODE ###

W,H,x,y = map(int,input().split())
if x == W/2 and y == H/2:
    a = 1
else:
    a = 0
print(W*H/2,a)
s = input() * 2
p = input()
print("Yes" if p in e else "No")


### FIXED CODE ###

s = input() * 2
p = input()
print("Yes" if p in s else "No")
from functools import lru_cache

N,M = list(map(int,input().split()))

e_list = [[] for i in range(N)]

for i in range(M):
    x,y = list(map(int,input().split()))
    x,y = x-1,y-1
    e_list[x].append(y)

@lru_cache(maxsize=500000)
def DFS(v):
    if len(e_list[v])==0:
        return 0
    res = 0
    for v1 in e_list[v]:
        res1 = DFS(v1)
        if res<res1+1:
            res = res1+1
    return res

ans = 0
for i in range(N):
    res = DFS(i)
    
    if res>ans:
        ans = res
print(ans)

### FIXED CODE ###

import sys

sys.setrecursionlimit(500000)


N,M = list(map(int,input().split()))

e_list = [[] for i in range(N)]

for i in range(M):
    x,y = list(map(int,input().split()))
    x,y = x-1,y-1
    e_list[x].append(y)

memo = [-1]*N

def DFS(v):
    if memo[v]!=-1:
        return memo[v]
    if len(e_list[v])==0:
        memo[v] = 0
        return 0
    res = 0
    for v1 in e_list[v]:
        res1 = DFS(v1)
        if res<res1+1:
            res = res1+1
    memo[v] = res
    return res

ans = 0
for i in range(N):
    res = DFS(i)
    if res>ans:
        ans = res
print(ans)
n = int(input())
A = list(map(int, input().split()))
pn = 0
 
for s in range(1, n+1):
    for t in range(s+A[s-1]+1, n+1):
        if A[s-1] + A[t-1] == t-s:
            pn += 1
 
print(pn)

### FIXED CODE ###

n,m=map(int,input().split())
for i in range(0,m):
  if n-2*i-1>n/2 or n%2==1 :
    print(i+1,n-i)
  else:
    print(i+1,n-i-1)
N, Q = map(int, input().split())
nodes = {str(i): [] for i in range(1, N+1)}
for _ in range(N-1):
    a, b = input().split()
    nodes[a] += [b]

PX = {str(i): 0 for i in range(1, N+1)}
for _ in range(Q):
    p, x_str = input().split()
    PX[p] += int(x_str)


node_cnts = [0] * (N+1)


def gen_subtree_nodes(node, count):
    node_cnts[int(node)] = count
    for n in nodes.get(node):
        subtree_nodes = gen_subtree_nodes(n, count + PX[n])


gen_subtree_nodes('1', PX['1'])

print(*node_cnts[1:])


### FIXED CODE ###

N, Q = map(int, input().split())
nodes = [[] for _ in range(2*(10**5)+1)]
for _ in range(N-1):
    a, b = map(int, input().split())
    nodes[a] += [b]

PX = [0 for _ in range(2*(10**5)+1)]
for _ in range(Q):
    p, x = map(int, input().split())
    PX[p] += x


node_cnts = [0] * (2*(10**5)+1)

q = [(1, PX[1])]
while q:
    node, count = q.pop()
    node_cnts[node] = count
    for n in nodes[node]:
        subtree_nodes = q.append((n, count + PX[n]))


print(*node_cnts[1:N+1], sep=' ')
import numpy as np 

H,W = map(int,input().split())
S = np.array([[[0,1][i == '.'] for i in input()] for _ in range(H)])

funcA = np.frompyfunc(lambda x,y:y and x+y,2,1)
funcB = np.frompyfunc(lambda x,y:x if y and x and 1 else y,2,1)
Hor = funcA.accumulate(S,dtype=np.object,axis=1).astype(np.int)[:,::-1]
Hor = funcB.accumulate(Hor,dtype=np.object,axis=1).astype(np.int)[:,::-1]
Ver = funcA.accumulate(S,dtype=np.object,axis=0).astype(np.int)[::-1,:]
Ver = funcB.accumulate(Ver,dtype=np.object,axis=0).astype(np.int)[::-1,:]
print(np.max(Hor+Ver-1))


### FIXED CODE ###

H,W = map(int,input().split())
S = [0]*H
for i in range(H):
    S[i] = list(input())

def aaa(s):
    i = 0
    l = len(s)
    o = []
    while True:
        if i == l:
            break
        if s[i] == ".":
            n = 0
            while i < l and s[i] == '.':
                i += 1
                n += 1
            o += [n] * n
        else:
            o += [0]
            i += 1
    return o

Hor = [0]*H
y = 0
while y != H:
    Hor[y] = aaa(S[y])
    y += 1

Ver = [0]*W
x = 0
while x != W:
    _ = 0
    s = [0] * H
    while _ != H:
        s[_] = S[_][x]
        _ += 1
    Ver[x] = aaa(s)
    x += 1

ans = 1
x = 0
while x != W:
    y = 0
    while y != H:
        h = Hor[y][x]
        if h:
            v = Ver[x][y]
            ans = max(ans,h+v-1)
        y += 1
    x += 1

print(ans)
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tup(t=int):return tuple(pin(t))
#%%code
def resolve():
    N,K=pin()
    H=[int(input()) for i in range(N)]
    H.sort()
    ans=1000000000
    for i in range(N-K+1):
        temp=[H[i],H[i+1],H[i+2]]
        xam=max(temp)
        nim=min(temp)
        ans=min(xam-nim,ans)
    print(ans)
#%%submit!
resolve()

### FIXED CODE ###

#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tup(t=int):return tuple(pin(t))
#%%code
def resolve():
    N,K=pin()
    H=[int(input()) for i in range(N)]
    H.sort()
    #print(H)
    ans=1000000000
    for i in range(N-K+1):
        ans=min(H[i+K-1]-H[i],ans)
    print(ans)
#%%submit!
resolve()
import itertools

if __name__ == '__main__':
    # P and Q are both rearrangements of (1, 2, ..., N)).
    # N! possible permutations of size N
    # among them, let P and Q be the a-th and the b-th
    n = int(input())
    p = list(map(int, input().split(' ')))
    q = list(map(int, input().split(' ')))

    realnums = p.copy()

    realnums.sort()

    perm = list(itertools.permutations(realnums))
    
    print(abs(perm.index(p) - perm.index(q)))

### FIXED CODE ###

import itertools

if __name__ == '__main__':
    # P and Q are both rearrangements of (1, 2, ..., N)).
    # N! possible permutations of size N
    # among them, let P and Q be the a-th and the b-th
    n = int(input())
    p = input().split(' ')
    q = input().split(' ')

    for i in range(0, len(q)):
        p[i] = int(p[i])
        q[i] = int(q[i])

    realnums = p.copy()

    realnums.sort()

    perm = list(itertools.permutations(realnums))

    it = 0

    qplace = 0
    pplace = 0

    for i in perm:
        if list(i) == q:
            qplace = it
        if list(i) == p:
            pplace = it
        it += 1
    print(abs(qplace - pplace))
N, X, T = map(int,input().split())
print(-(-N // x) * t)

### FIXED CODE ###

from math import ceil
N, X, T = map(int,input().split())
print(ceil(N / X) * T)
a = input()
b = 0
if s == "SSS":
    print(0)
elif s == "SSR":
    print(1)
elif s == "SRS":
    print(1)
elif s == "SRR":
    print(2)
elif s == "RSS":
    print(1)
elif s == "RSR":
    print(1)
elif s == "RRS":
    print(2)
elif s == "RRR":
    print(3)

        

### FIXED CODE ###

s = input()
if s == "SSS":
    print(0)
elif s == "SSR":
    print(1)
elif s == "SRS":
    print(1)
elif s == "SRR":
    print(2)
elif s == "RSS":
    print(1)
elif s == "RSR":
    print(1)
elif s == "RRS":
    print(2)
elif s == "RRR":
    print(3)
def get(num):
    n=0
    is_prime=[0]*200050
    for i in range(0,num+1):
        is_prime[i]=True
    is_prime[0]=is_prime[1]=False
    for i in range(2,num+1):
        if(is_prime[i]):
            n+=1
            for j in range(2*i,num+1,i):
                is_prime[j]=False
    return n

while True:
    a=map(int,raw_input().strip().split())
    b=a[0]
    if(b==0):
        break
    p=get(2*b)-get(b)

#        p=0
#        for i in range(b+1,2*b+1):
#            if(judge(i)):
#                p+=1
    print(p)



### FIXED CODE ###

def get(num):
    n=0
    is_prime=[0]*300050
    for i in range(0,num+1):
        is_prime[i]=True
    is_prime[0]=is_prime[1]=False
    for i in range(2,num+1):
        if(is_prime[i]):
            n+=1
            for j in range(2*i,num+1,i):
                is_prime[j]=False
    return n

while True:
    a=map(int,raw_input().strip().split())
    b=a[0]
    if(b==0):
        break
    p=get(2*b)-get(b)

#        p=0
#        for i in range(b+1,2*b+1):
#            if(judge(i)):
#                p+=1
    print(p)
input_a=input()
input_aa=input()
input_aaa=input()

a=int(input_a)
aa=int(input_aa)
aaa=int(input_aaa)

if a+aa+aaa>=22: print("bust")
else: print("win")

### FIXED CODE ###

a,b,c=map(int,input().split())

if a+b+c>=22: print("bust")
else: print("win")
# -*- coding: utf-8 -*-
import collections
# factrize
def factorize(target_number):
    factor_list = []
    while target_number % 2 == 0:
        factor_list.append(2)
        n //= 2
    factor = 3
    while factor * factor <= target_number:
        while target_number % factor == 0:
            target_number //= factor
            factor_list.append(factor)
        factor += 2
    if target_number > 1:
        factor_list.append(target_number)
    return factor_list

N = int(input())

fact_list = factorize(N)

fact_counter_dict = collections.Counter(fact_list)
ans = 0
for fact, freq in fact_counter_dict.items():
    freq_copy = freq
    for i in range(1, freq + 1):
        freq_copy -= i
        if freq_copy < 0:
            break
        ans += 1
print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import collections
# factrize
def factorize(target_number):
    factor = 2
    factor_list = []
    while factor * factor <= target_number:
        while target_number % factor == 0:
            target_number //= factor
            factor_list.append(factor)
        factor = factor + 1
    if target_number > 1:
        factor_list.append(target_number)
    return factor_list

N = int(input())

fact_list = factorize(N)

fact_counter_dict = collections.Counter(fact_list)
ans = 0
for fact, freq in fact_counter_dict.items():
    freq_copy = freq
    for i in range(1, freq + 1):
        freq_copy -= i
        if freq_copy < 0:
            break
        ans += 1
print(ans)
from sys import stdin

def main():
    bw=stdin.readline().replace('B', '0').replace('W', '1')
    A=list(map(int,bw))
    #A = list(map(int,stdin.readline().replace('B', '0').replace('W', '1')))

    A=[0,0,1]
    wc = A.count(1)
    indices = [i for i, x in enumerate(A) if x == 1]
    if wc > 0:
      print(sum(indices) - 1*wc*(wc-1) //2 )
    else:
      print(sum(indices))

input = lambda: stdin.readline()
main()


### FIXED CODE ###

from sys import stdin

def main():
    A=stdin.readline().replace('B', '0').replace('W', '1')
    #A=list(map(int,bw))
    #A = list(map(int,stdin.readline().replace('B', '0').replace('W', '1')))

    wc = A.count('1')
    indices = [i for i, x in enumerate(A) if x == '1']
    if wc > 0:
      print(sum(indices) - 1*wc*(wc-1) //2 )
    else:
      print(sum(indices))

input = lambda: stdin.readline()
main()
import math

n, k = map(int, input().split())


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


for i in range(1, k + 1):
    tmp1 = combinations_count(k - 1, i - 1) % 1000000007
    tmp2 = combinations_count(n - k + 1, i) % 1000000007
    ans = (tmp1 * tmp2) % 1000000007
    print(ans)
    if ans == 1:
        exit()


### FIXED CODE ###

import math

n, k = map(int, input().split())


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


for i in range(1, k + 1):
    if n - k + 1 >= i:
        tmp1 = combinations_count(k - 1, i - 1) % 1000000007
        tmp2 = combinations_count(n - k + 1, i) % 1000000007
        ans = (tmp1 * tmp2) % 1000000007
        print(ans)
    else:
        print(0)
A,B,C,X = int(input() for i in range(4))
print([500*a+100*b+50*c for c in range(C+1) for b in range(B+1) for a in range(A+1)].count(X))

### FIXED CODE ###

A,B,C,X=[int(input()) for i in range(4)]
print([500*a+100*b+50*c for c in range(C+1) for b in range(B+1) for a in range(A+1)].count(X))
n, x = input().strip().split()
n = int(n)
x = int(x)
l = input().strip().split()
now = 0
for i in range(n):
  now += l[i]
  if now > x:
    print(i)
    exit()

### FIXED CODE ###

n, x = input().strip().split()
n = int(n)
x = int(x)
l = input().strip().split()
l = list(map(int, l))
now = 0
for i in range(n):
  now += l[i]
  if now > x:
    print(i+1)
    exit()
print(n+1)
n,m=map(int, input().split())
s=input()
t=input()
def euc(x,y):
  if x % y==0:
    return x
  else:
    return euc(max(x,y) % min (x,y),min(x,y))
d=euc(n,m)
ans=n*m/d
if d==1:
  print(n*m)
else:
  for i in range(d):
    if s[i*int(n/d)]!=t[i*int(m/d)]:
      ans=-1
  print(ans)

### FIXED CODE ###

n,m=map(int, input().split())
s=input()
t=input()
def euc(x,y):
  if max(x,y) % min(x,y)==0:
    return min(x,y)
  else:
    return euc(max(x,y) % min (x,y),min(x,y))
d=euc(n,m)
ans=n*int(m/d)
if d==1:
  if s[0]==t[0]:
    print(n*m)
  else:
    print(-1)
else:
  for i in range(d):
    if s[i*int(n/d)]!=t[i*int(m/d)]:
      ans=-1
  print(ans)
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b=INTM()
    if (a+b)%2==!:
        print('IMPOSSIBLE')
    else:
        print((a+B)//2)
if __name__ == '__main__':
    do()

### FIXED CODE ###

INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b=INTM()
    if (a+b)%2==1:
        print('IMPOSSIBLE')
    else:
        print((a+b)//2)
if __name__ == '__main__':
    do()
import sys
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
for z in range(101):
  if X<z<=Y and x[i]<z for i in range(n) and y[j]>=z for j in range(m):
    print('No War')
    sys.exit()
for z in range(1,101):
  if X<z*(-1)<=Y and x[i]<z*(-1) for i in range(n) and y[j]>=z*(-1) for j in range(m):
    print('No War')
    sys.exit()
print('War')


### FIXED CODE ###

import sys
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
for z in range(101):
  if X<z<=Y and all(x[i]<z for i in range(n)) and all(y[j]>=z for j in range(m)):
    print('No War')
    sys.exit()
for z in range(1,101):
  if X<z*(-1)<=Y and all(x[i]<z*(-1) for i in range(n)) and all(y[j]>=z*(-1) for j in range(m)):
    print('No War')
    sys.exit()
print('War')
s=input() u=input()
a,b=map(int,input().split())
u=input()
print(a-1 b if s==u else a b-1)


### FIXED CODE ###

s,t=input().split()
a,b=map(int,input().split())
u=input()
print(a-1, b) if u==s else print(a, b-1)
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
    break

    count = 0
    for a in range(1, x // 3):
        for b in range(a + 1, x // 2):
            for c in range(b + 1, n + 1):
                Sum = a + b + c
                if (Sum == x):
                    count += 1 
    print(count)

### FIXED CODE ###

while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

    count = 0
    for a in range(1, x // 3):
        for b in range(a + 1, x // 2):
            for c in range(b + 1, n + 1):
                Sum = a + b + c
                if (Sum == x):
                    count += 1 
    print(count)
n = int(input())
a = list(map(int,input().split()))

a_min = min(a)
ans = 0
for x in range(2,1000000,2):
    if a_min%2 == 0 and a_min > 0:
        a += 1
        contnue
    else:
        break

for y in a:
    if y%2==1:
        ans -= 100000000



if ans > 0:
    print(ans)
else:
    print(0)

### FIXED CODE ###


n = int(input())
a = list(map(int,input().split()))

l = []
ans = 0

for x in range(n):
    for _ in range(10000000):
        if a[x]%2 == 0 and a[x] > 0:
            a[x] = a[x]//2
            ans += 1
            continue
        else:
            l.append(ans)
            ans = 0
            break

print(min(l))
print(['Even','Odd'][max(0,sum(map(lambda x:int(x)%2,input()))-1)])

### FIXED CODE ###

print(['Even','Odd'][max(0,sum(map(lambda x:int(x)%2,input().split()))-1)])
n,m = map(int,input().split())
A = list(map(int.input().split()))

for i in range(m):
  n -= A(i)
  
if n < 0:
  print(-1)
else:
  print(n)

### FIXED CODE ###

n,m = map(int,input().split())
A = list(map(int,input().split()))
 
for i in range(m):
  n -= A[i]
  
if n < 0:
  print(-1)
else:
  print(n)