Harryxun/stf_run huggingface dataset:
n, m = map(int, input().split(" "))

def abs(n):
    return n if n>0 else -n


for i in range(1, n+1):
    ab = list(map(int, input().split(" ")))
for j in range(1, m+1):
    cd = list(map(int, input().split(" ")))

for i in range(0, n):
    delta = 999999999999
    ans=0
    for j in range(0, m):
        newdelta = abs(ab[i][0]-cd[j][0]) + abs(ab[i][1]-cd[j][1])
        if delta>newdelta:
            delta=newdelta
            ans=j+1
    print(ans)



### FIXED CODE ###

import math;

n, m = map(int, input().split(" "));
ab = [];
for i in range(0, n):
    ab.append(input().split(" "));

cd = [];
for i in range(0, m):
    cd.append(input().split(" "));

for i in range(0, n):
    dist=9999999999999
    nearm=0;
    for j in range(0, m):
         dist2 = math.fabs(int(ab[i][0]) - int(cd[j][0])) + math.fabs(int(ab[i][1]) - int(cd[j][1]));
         if dist2 < dist:
            dist = dist2;
            nearm=j;
    print(nearm+1);
S, T = input().split()
a, b = int(input.split())
U = input()
if str(S) == str(U):
  print(a-1)
else:
  print(b-1)

### FIXED CODE ###

S, T = input().split(" ")
A, B = [int(i) for i in input().split(" ")]
U = input()
 
if S==U :
  print("{} {}".format(A-1,B))
else:
  print("{} {}".format(A,B-1))
import sys
n = int(input())
d = list(map(int, input().split()))
m = {}
ans = 1

if d[0] != 0:
    print(0)
    sys.exit()

for i in range(n):
    num = d[i]
    if num in m:
        m[num] += 1
    else:
        m[num] = 1

#print(m)
#print(max(m))

#for i in range(1, max(m)+1):
for i in range(0, max(m)):
    if i not in m:
        print(0)
        sys.exit()
    prevCnt = m[i]
    curCnt = m[i+1]
    # prevCnt = m[i] % 998244353
    #curCnt = m[i+1] % 998244353
    ans *= prevCnt ** curCnt
    #ans *= (prevCnt ** curCnt) % 998244353

print(ans % 998244353)







### FIXED CODE ###

import sys
n = int(input())
d = list(map(int, input().split()))
m = {}
ans = 1

if d[0] != 0:
    print(0)
    sys.exit()

if d.count(0) > 1:
    print(0)
    sys.exit()

for i in range(n):
    num = d[i]
    if num in m:
        m[num] += 1
    else:
        m[num] = 1

# if len(m) < n:
#     print(0)
#     sys.exit()

#print(m)
#print(max(m))
maxV = max(m.keys())

#for i in range(1, max(m)+1):
#for i in range(0, max(m)):
for i in range(0, maxV):
    if i not in m or i + 1 not in m:
        print(0)
        sys.exit()
    prevCnt = m[i]
    curCnt = m[i+1]
    # prevCnt = m[i] % 998244353
    #curCnt = m[i+1] % 998244353
    ans *= prevCnt ** curCnt
    #ans *= (prevCnt ** curCnt) % 998244353

print(ans % 998244353)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

n=I()
nl=[[] for i in range(n)]
used=[False for i in range(n)]
for i in range(n-1):
    a,b,c=IL()
    nl[a-1].append([b-1,c])
    nl[b-1].append([a-1,c])
d=[None for i in range(n)]
def dfs(now,pre,dis):
    used[now]=True
    d[now]=dis
    for i in nl[now]:
        if i[0]!=pre and not used[i[0]]:
            dfs(i[0],now,dis+i[1])
    
    return
q,k=IL()
dfs(k-1,-1,0)
for i in range(q):
    x,y=IL()
    print(d[x-1]+d[y-1])

### FIXED CODE ###

def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
import sys
sys.setrecursionlimit(10 ** 6)
n=I()
nl=[[] for i in range(n)]
used=[False for i in range(n)]
for i in range(n-1):
    a,b,c=IL()
    nl[a-1].append([b-1,c])
    nl[b-1].append([a-1,c])
d=[None for i in range(n)]
def dfs(now,pre,dis):
    used[now]=True
    d[now]=dis
    for i in nl[now]:
        if i[0]!=pre and not used[i[0]]:
            dfs(i[0],now,dis+i[1])
    
    return
q,k=IL()
dfs(k-1,-1,0)
for i in range(q):
    x,y=IL()
    print(d[x-1]+d[y-1])
from scipy.special import comb
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

mod = 1000000007
X_max = 0
X_min = 0

for i in range(N-K+1):
    n = comb(N-1-i, K-1)
    X_max += n*A[-(i+1)]
    X_max %= mod
    X_min += n*A[i]
    X_min %= mod

print(int((X_max - X_min) % mod))


### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

p = 1000000007
X_max = 0
X_min = 0


def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % p


fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)


for i in range(N-K+1):
    n = cmb(N-1-i, K-1, p)
    X_max += n*A[-(i+1)]
    X_max %= p
    X_min += n*A[i]
    X_min %= p

print(int((X_max - X_min) % p))
import decimal
A,B = map(int,input().split())
A = decimal(A)
B = decimal(B)
print(int(A*B))

### FIXED CODE ###

from decimal import Decimal
A,B = map(str,input().split())
A = Decimal(A)
B = Decimal(B)
print(int(A*B))
import itertools
from scipy.sparse.csgraph import floyd_warshall

N,M,R=map(int,input().split())
r=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(M)]

s=[[float('inf') for i in range(N)] for i in range(N)]
for i in range(M):
    a,b,c=l[i]
    s[a-1][b-1]=c
    s[b-1][a-1]=c
for i in range(N):
    s[i][i]=0

s=floyd_warshall(s)
#print(s)
ans=10**9
for i in itertools.permutations(r):
#    print(i)
    temp_ans=0
    for j in range(R-1):
        temp_ans+=s[i[j]-1][i[j+1]-1]
    ans=min(ans,temp_ans)
print(int(ans))

### FIXED CODE ###

import itertools
from scipy.sparse.csgraph import floyd_warshall

N,M,R=map(int,input().split())
r=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(M)]

s=[[float('inf') for i in range(N)] for i in range(N)]
for i in range(M):
    a,b,c=l[i]
    s[a-1][b-1]=c
    s[b-1][a-1]=c
for i in range(N):
    s[i][i]=0

s=floyd_warshall(s)
#print(s)
ans=10**9
for i in itertools.permutations(r):
#    print(i)
    temp_ans=0
    for j in range(R-1):
        temp_ans+=s[i[j]-1][i[j+1]-1]
    ans=min(ans,temp_ans)
print(int(ans))
def solve(n, m, h, a, b):
    parent = {i:i for i in range(1, n+1)}
    def root(x):
        return x if parent[x] == x else root(parent[x])

    for a_j, b_j in zip(a, b):
        if root(a_j) != root(b_j):
            if a_j > b_j:
                a_j, b_j = b_j, a_j
            parent[root(b_j)] = root(a_j)
    D = {}
    for j, pj in parent.items():
        if not pj in D:
            D[pj] = []
        D[pj].append(h[j-1])
    ans = 0
    for k, v in D.items():
        v = sorted(v)
        if len(v) == 1:
            ans += 1
        elif v[-1] > v[-2]:
            ans += 1
    return ans

n, m = map(int, input().split())
h = list(map(int, input().split()))
a = [0] * m
b = [0] * m
for j in range(m):
    a[j], b[j] = map(int, input().split())
print(solve(n,m, h, a, b))

### FIXED CODE ###

def solve(n, m, h, a, b):
    for j in range(m):
        a[j] -= 1
        b[j] -= 1
    E = {i:[] for i in range(n)}
    for x, y in zip(a, b):
        E[x].append(y)
        E[y].append(x)
    ans = 0
    for i in range(n):
        ok = True
        for j in E[i]:
            if h[i] <= h[j]:
                ok = False
        ans += ok
    return ans
n, m = map(int, input().split())
h = list(map(int, input().split()))
a = [0] * m
b = [0] * m
for j in range(m):
    a[j], b[j] = map(int, input().split())
print(solve(n,m, h, a, b))
a,b=map(int,input().split())
c=list(map(int,input().split()))
c.sort()
a-=c[-1]
a-=c[-2]

if a<=0:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

a,b=map(int,input().split())
c=list(map(int,input().split()))
for i in range(b):
  a-=c[i]
if a<=0:
  print('Yes')
else:
  print('No')
import numpy as np
h, w = map(int, input().split())
m = np.array([list(map(int, input().split())) for i in range(h)])

n = list()
r = True
act = list()
for i in range(h):
  r = not r
  for j in sorted(range(w), reverse=r):      
    if not r:
      # 下に進む
      if j == w-1:
        if i == w:
          break
        next_i = i + 1
        next_j = j
      # 右に進む
      else:
        next_i = i
        next_j = j + 1
    else:
      # 下に進む
      if j == 0:
        if i == w:
          break
        next_i = i
        next_j = j + 1
      # 左に進む
      else:
        next_i = i
        next_j = j - 1
    #print(m[i, j], i, j, r, m[next_i, next_j])
    
    if m[i, j] % 2 == 1:
      m[i, j] -= 1
      m[next_i, next_j] += 1
      act.append((i+1, j+1, next_i+1, next_j+1))

print(len(act))
[print(*x) for x in act]  
#print(m)


### FIXED CODE ###

import numpy as np
h, w = map(int, input().split())
m = np.array([list(map(int, input().split())) for i in range(h)])

r = True
act = list()
for i in range(1, h+1):
  r = not r
  for j in sorted(range(1, w+1), reverse=r):
    if m[i-1, j-1] % 2 == 1:
      if not r:
        # 下に進む
        if j == w:
          if i == h:
            break
          m[i, j-1] += 1
          act.append((i, j, i+1, j))
        # 右に進む
        else:
          m[i-1, j] += 1
          act.append((i, j, i, j+1))
      else:
        # 下に進む
        if j == 1:
          if i == h:
            break
          m[i, j-1] += 1
          act.append((i, j, i+1, j))
        # 左に進む
        else:
          m[i-1, j-2] += 1
          act.append((i, j, i, j-1))
    #print(m[i, j], i, j, r, m[next_i, next_j])
    
print(len(act))
[print(*x) for x in act]  
#print(m)
# 幅優先探索, BFS

from collections import deque

n, m = list(map(int, input().split()))
edges = [list(map(int, input().split())) for _ in range(m)]

neighbor = [[] for _ in range(m)]
for edge in edges:
    neighbor[edge[0]-1].append(edge[1]-1)  # 1- → 0-index
    neighbor[edge[1]-1].append(edge[0]-1)

queue = deque()
queue.append(0)

back = [-1] * n  # visitしたかどうかを兼ねる
back[0] = 0
while len(queue) > 0:
    vertex = queue.popleft()
    for nei in neighbor[vertex]:
        if back[nei] == -1:
            back[nei] = vertex
            queue.append(nei)
        
print('Yes')
for i in back[1:]:
    print(i+1)  # 0- → 1-index


### FIXED CODE ###

# 幅優先探索, BFS

from collections import deque

n, m = list(map(int, input().split()))
edges = [list(map(int, input().split())) for _ in range(m)]

neighbor = [[] for _ in range(n)]
for edge in edges:
    neighbor[edge[0]-1].append(edge[1]-1)  # 1- → 0-index
    neighbor[edge[1]-1].append(edge[0]-1)

queue = deque()
queue.append(0)

back = [-1] * n  # visitしたかどうかを兼ねる
back[0] = 0
while len(queue) > 0:
    vertex = queue.popleft()
    for nei in neighbor[vertex]:
        if back[nei] == -1:
            back[nei] = vertex
            queue.append(nei)
        
print('Yes')
for i in back[1:]:
    print(i+1)  # 0- → 1-index
n = int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if (x+y) > t and (x+y)%2 != t%2):
        print("No")
        exit()
print("Yes")

### FIXED CODE ###

n = int(input())
pretime, prex, prey = 0, 0, 0
for i in range(n):
    nowtime, nowx, nowy = map(int, input().split())
    time = nowtime - pretime
    x = abs(nowx - prex)
    y = abs(nowy - prey)
    if x+y > time:
        print("No")
        exit()
    if (x+y) % 2 != time % 2:
        print("No")
        exit()
    pretime = nowtime
    prex, prey = nowx, nowy
else:
    print("Yes")
import sys
input=sys.stdin.readline
import numpy as np
 
def main():
    numbers=[]
    a,b,k = map(int,input().rstrip().split())
    numbers=np.arange(a,b+1)
    A=set(numbers[:min(k,b+1)])
    B=set(numbers[max(b-k,a):])
    answer = A.union(B)
    
    for i in sorted(answer):
        print("{}".format(i))
 
 
if __name__=="__main__":
    main()

### FIXED CODE ###

a, b, k = [int(i) for i in input().split()]

lim_1 = min(a + k, b)
lim_2 = max(b - k + 1, a)
ans = set(list(range(a, lim_1)) + list(range(lim_2, b + 1)))

for n in ans:
    print(n)
l = ['A', 'C', 'T', 'G']
b = input()
for i in range(3):
    if l[i] == b:
        print(l[(i+2)/4])
        break

### FIXED CODE ###

l = ['A', 'C', 'T', 'G']
b = input()
for i in range(4):
    if l[i] == b:
        print(l[(i+2)%4])
        break
n,a,b = map(int, input().split())
if n/2 < a: a=n-a
if n/2 < b: b=n-b
total, combination = 0,1

for i in range(1,(n-1)//2+1):
    combination = combination*(n-i+1)/i
    total += combination
    if a == i: a_cnt = combination
    if b == i: b_cnt = combination
        
    total = total%(10**9+7)

if n == 2:
    print(0)
elif n%2==0:
    answer = total*2+combination*(n-i)/(i+1)-a_cnt-b_cnt+1
    print(answer%(10**9+7))
else:
    answer = total*2-a_cnt-b_cnt+1
    print(answer%(10**9+7))

### FIXED CODE ###

def pow_self(x,n):
    ans = 1
    while n>0:
        if n&1 == 1:
            ans = (ans*x)%(10**9+7)
            
        x = (x*x)%(10**9+7)
        n >>= 1
    return ans

  
n,a,b = map(int, input().split())        
X,Y = 1,1
for i in range(b):
    X *= n-i
    X %= 10**9+7
    Y *= i+1
    Y %= 10**9+7

    if a-1 == i:
        Xa,Ya = X,Y

comb_a = (Xa*pow_self(Ya,10**9+5))%(10**9+7)
comb_b = (X*pow_self(Y,10**9+5))%(10**9+7)

result = pow_self(2,n)-1-comb_a-comb_b
while result <0:
    result += 10**9+7
print(result)
n = int(input()[-1])
if n in [2, 4, 5, 7, 9]: print('hon')
else if n in [0, 1, 6, 8]: print('pon')
else: print('bon')

### FIXED CODE ###

n = int(input()[-1])
if n in [2, 4, 5, 7, 9]: print('hon')
elif n in [0, 1, 6, 8]: print('pon')
else: print('bon')
import re

def nchars(s, n):
    """文字列 s に、同じ文字が n 個以上連続している部分文字列を見つける
    """
    assert n > 0
    reg = re.compile("(.)\\1{%d,}" % (n - 1))  # カンマを取ると n 個ちょうどになる
    while True:
        m = reg.search(s)
        if not m:
            break
        yield m.group(0)
        s = s[m.end():]

S = input()
K = int(input())

con = list(nchars(S, 2))
cons = []
for coni in con:
    cons.append(int(len(coni)/2))

c1 = cons[0]

c2 = 0
for i in range(len(cons)):
    if i != 0 and i != len(cons)-1:
        c2 += consi[i]

c3 = int(cons[0]+cons[len(cons)-1])/2

c4 = int(cons[len(cons)-1])

print(int(c1 + c2*K + c3 *(K-1) + c4))


### FIXED CODE ###

import re

def nchars(s, n):
    """文字列 s に、同じ文字が n 個以上連続している部分文字列を見つける
    """
    assert n > 0
    reg = re.compile("(.)\\1{%d,}" % (n - 1))  # カンマを取ると n 個ちょうどになる
    while True:
        m = reg.search(s)
        if not m:
            break
        yield m.group(0)
        s = s[m.end():]

S = input()
K = int(input())

con = list(nchars(S, 1))
#print(con)
if len(con)==1:
    print(int(len(S)*K/2))

else:
    cons = []
    for coni in con:
        cons.append(int(len(coni)/2))

    c1 = cons[0]

    c2 = 0
    for i in range(len(cons)):
        if i != 0 and i != len(cons)-1:
            c2 += cons[i]

    if con[0][0]==con[-1][0]:
        c3 = int(len(con[0]+con[-1])/2)
    else:
        c3 = int(len(con[0])/2) + int(len(con[-1])/2)

    c4 = int(cons[-1])

    print(int(c1 + c2*K + c3 *(K-1) + c4))
S=list(input())
MOD=10**9+7
dp=[0]*13
dp[0]=1
for i in range(1,len(S)+1):
    ans=[0]*13
    if S[-i]=="?":
        for j in range(10):
            a=(j*10**(i-1))%13
            for k in range(13):
                ans[(k+a)%13]=ans[(k+a)%13]+dp[k]
    else:
        a=int(S[-i])
        a=(a*10**(i-1))%13
        for k in range(13):
            ans[(k+a)%13]=ans[(k+a)%13]+dp[k]
    dp=ans.copy()
print(ans[5]%MOD)

### FIXED CODE ###

S=input()
MOD=10**9+7
dp=[[0]*13 for i in range(len(S)+1)]
dp[0][0]=1
for i in range(len(S)):
    if S[i]=="?":
        for j in range(10):
            for k in range(13):
                dp[i+1][(10*k+j)%13]+=dp[i][k]%MOD
    else:
        a=int(S[i])
        for k in range(13):
            dp[i+1][(10*k+a)%13]+=dp[i][k]%MOD
print(dp[len(S)][5]%MOD)
def popcount(x):
    return bin(x).count("1")

n=int(input())
s=input()
X=int(s,2)



one_cnt=popcount(X)

modp=X%(one_cnt+1)
modm=X%(one_cnt-1) if one_cnt-1!=0 else 0

for i in range(n):
    if s[i]=="1":
        if cnt==1:
            print(0)
            continue
        else:
            num=(modm-pow(2,n-i-1,one_cnt-1))%(one_cnt-1)
    else:
        num=(modp+pow(2,n-i-1,one_cnt+1))%(one_cnt+1)


    cnt=1
    while num!=0:
        num=num%popcount(num)
        cnt+=1
    print(cnt)












### FIXED CODE ###

def popcount(x):
    return bin(x).count("1")

n=int(input())
s=input()
X=int(s,2)

one_cnt=popcount(X)

modp=X%(one_cnt+1)
modm=X%(one_cnt-1) if one_cnt-1!=0 else 0

for i in range(n):
    if s[i]=="1":
        if one_cnt-1==0:
            print(0)
            continue
        else:
            num=(modm-pow(2,n-i-1,one_cnt-1))%(one_cnt-1)
    else:
        num=(modp+pow(2,n-i-1,one_cnt+1))%(one_cnt+1)

    #print(i,"num",num)
    cnt=1
    while num!=0:
        num=num%popcount(num)
        cnt+=1
    print(cnt)
# coding: utf-8
from math import factorial
N, K = map(int, input().split())
mod = 10**9 + 7
def combination(n, r):
    return int(factorial(n) / (factorial(r) * factorial(n - r)))

for i in range(1, K+1):
    if i%2 == 0:
        print(combination(N-K+1, i)*2%mod)
    else:
        print(combination(N-K+1, i)%mod)

### FIXED CODE ###

# coding: utf-8
from math import factorial
def combination(n, r):
    if n >= r and n >= 0 and r >= 0:
        return int(factorial(n) // (factorial(r) * factorial(n - r)))
    else:
        return 0
N, K = map(int, input().split())
mod = 10**9 + 7

for i in range(1, K+1):
    print(combination(N-K+1, i) * combination(K-1, i-1)%mod)
# abc165_d.py
from math import floor
A, B,N = map(int,input().split())
ans = 0
for i in range(1,A):
    t = floor(A*i/B)-A*floor(i/B)
#    print(i, t,floor(A*i/B),A*floor(i/B))
    if ans<=t:
        ans = t
print(ans)# abc165_d.py
from math import floor
A, B,N = map(int,input().split())
ans = -100000000
for i in range(1,A):
    t = floor(A*i/B)-A*floor(i/B)
#    print(i, t,floor(A*i/B),A*floor(i/B))
    if ans<=t:
        ans = t
print(ans)

### FIXED CODE ###

import math
def f(x):
    return math.floor(A*x/B)

A, B, N = map(int, input().split())
print(f(min(B-1,N)))
def f(exponent):
	#reurns how many times a prime raised to exponent can be used
	step = 1
	cumul = 0
	count = 0
	while( cumul <= exponent):
		cumul += step
		count +=1
		step +=1
	return count - (1 if cumul > exponent else 0)

def answer(n):
	if n == 1: return 0
	res = 0
	on = n
	for d in range(2, int(on ** 0.5) + 1)
		if n % d == 0:
			e = 0
			while(n%d == 0): e +=1
			res+= f(e)
		d +=1
	return res if n == 1 else 1

### FIXED CODE ###

def f(exponent):
	#reurns how many times a prime raised to exponent can be used
	step = 1
	cumul = 0
	count = 0
	while( cumul <= exponent):
		cumul += step
		count +=1
		step +=1
	return count - (1 if cumul > exponent else 0)

def answer(n):
	if n == 1: return 0
	res = 0
	on = n
	p = True
	for d in range(2, int(on ** 0.5) + 2):
		if n % d == 0:
			p = False
			e = 0
			while(n%d == 0): 
				e +=1
				n/=d
			res+= f(e)
	if n > 1: res += 1
	return res

print answer(int(raw_input()))
import re

r = re.compile('^[0-9]')

words = []
while True:
  try:
    w = raw_input()
    words.append(w) if r.match(w) == None
  except:
    break
words.sort()
print words[0]

### FIXED CODE ###

import re

words = []
while True:
    try:
        w = raw_input()
        if re.match('[0-9]', w) == None:
            words.append(w)
    except:
        break
words.sort()
print words[0]
x=input()
if x==1:
  print("0")
elif x==0:
  print("1")
else:
  break

### FIXED CODE ###

x=int(input())
if x==1:
  print("0")
if x==0:
  print("1")
from fractions import gcd

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

def lcm(x, y):
    return (x*y)//gcd(x,y)
    
tmp = lcm(a, b)
print(tmp)

### FIXED CODE ###

x = int(input())

ans = 0

for i in range(x, 100004):
    tmpf = 1
    for j in range(2, int(i**0.5)):
        if i % j == 0:
            tmpf = 0
            break
    if tmpf == 1:
        ans = i
        break
    
print(ans)
N = 0
numbers = array()

N = int(input())
numbers = [1/int(i) for i in input().split()]

print(1/sum(numbers))

### FIXED CODE ###

N = 0
numbers = []

N = int(input())
numbers = [1/int(i) for i in input().split()]

print(1/sum(numbers))
n,k = map(int,input().split())
A = list(map(int,input().split()))
if n==1:
    print(A[0])
    exit()
l = len(bin(k)[2:])
digit = [0]*l
for a in A:
    b = str(format(a, '0{}b'.format(l)))
    for e,c in enumerate(b):
        digit[e] += int(c)
ret = ''
for d in digit:
    if d > l//2:
        ret += '0'
    else:
        ret += '1'

ret = int(ret, 2)

ans = 0
for a in A:
    ans += ret^a
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
A = list(map(int,input().split()))
cnt = [0]*50
L = format(k, 'b').zfill(50)
S = [[0,0] for _ in range(50)]
for a in A:
    a_ = format(a, 'b').zfill(50)
    for i in range(50):
        if a_[i]=='1':
            S[i][0] += 1
        else:
            S[i][1] += 1
for i in range(len(S)):
    S[i][0] *= pow(2, 50-i-1)
    S[i][1] *= pow(2, 50-i-1)

dp = [[-1,-1] for _ in range(55)]
dp[0][0] = 0

for i in range(50):
    
    if L[i] == '1':
        if dp[i][1] != -1:
            dp[i+1][1] = dp[i][1] + max(S[i][0], S[i][1])
        if dp[i][0] != -1:
            dp[i+1][1] = max(dp[i+1][1], dp[i][0]+S[i][0])
            dp[i+1][0] = dp[i][0] + S[i][1]
        
            
    else:
        if dp[i][1] != -1:
            dp[i+1][1] = dp[i][1] + max(S[i][1], S[i][0])
        if dp[i][0] != -1:
            dp[i+1][0] = dp[i][0] + S[i][0]

print(max(dp[50]))
s=[input() for i in range 3]

if s[0]==s[1]:
  if s[1]==s[2]:
    print("No")
  else:
    printf("Yes")
    
else:
  if s[0]==s[2] or s[1]==s[2]:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

a,b,c = input().strip().split()

if a==b:
  if b==c:
    print("No")
  else:
    print("Yes")
    
else:
  if a==c or b==c:
    print("Yes")
  else:
    print("No")
n,m=map(int, input().split())
l=[]
cnt=0
for i in range(m):
    s,c=map(int, input().split())
    l.append([s,c])
    if s==1 and c==0: #最上位の位が1の時に対する処理
        cnt+=1
buf=0
for i in range(m-1):
    for j in range(i+1,m):
        if l[i][0]==l[j][0] and l[i][1]!=l[j][1]:
            buf+=1
if buf!=0 or cnt!=0:
    print('-1')
else:
    l.sort()
    ans=l[0][1]*(10**(n-l[0][0]))
    for i in range(1,m):
        if l[i-1][0]==l[i][0]:
            continue
        else:
            ans+=l[i][1]*(10**(n-l[i][0]))
    print(ans)

### FIXED CODE ###

import sys
n,m=map(int,input().split())
ans=[0]*n
scash=[]
buf=0
for i in range(m):
    s,c=map(int,input().split())
    if s not in scash:
        ans[s-1]+=c
        scash.append(s)
    elif (s in scash) and c!=ans[s-1]:
        buf+=1
        scash.append(s)
if n==1 and ans[0]==0:
    print(0)
    sys.exit()
if buf==0 and ans[0]!=0:
    anstr=[str(num) for num in ans]
    print(''.join(anstr))
elif buf==0 and (1 not in scash):
    ans[0]+=1
    anstr=[str(num) for num in ans]
    print(''.join(anstr))
else:
    print(-1)
n = input()
ans = 0
for i in range(1, len(n)):
    if i%2: ans+=10**(i-1)*9
if len(n)%2: ans += int(n[1:])+1
print(ans)

### FIXED CODE ###

ans = 0
for i in range(1, int(input())+1):
    if len(str(i))%2: ans+=1
print(ans)
S = input()

if S[2] == S[3] and S[4] == S[5]
    print("Yes")
else:
    print("No`")

### FIXED CODE ###

S = input()

if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")
import math as m
from functools import reduce

n=int(input())
l=set([])
def gcd(a,b):
    while a != 0:
        c = a
        a = b % a
        b = c
    return b
def f(a,b):
    return int(a*b/gcd(a,b))
for i in range(n):
    l.add(int(input()))
print(reduce(f,l))

### FIXED CODE ###

import math as m
from functools import reduce
n,T= int(input()),[]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
for i in range(n):
    T.append(int(input()))
tmp = max(T)
for i in range(n):
    if tmp % T[i] != 0:
        tmp = T[i]//gcd(tmp, T[i])*tmp

print(tmp)