Harryxun/stf_run huggingface dataset:
import numpy as np
A_ele = []
B_ele = []
ele = [int(x) for x in input().split()]
for i in range(ele[0]):
    A_ele.append([int(x) for x in input().split()])
A_ele = np.array(A_ele)
for i in range(ele[1]):
    B_ele.append([int(x) for x in input().split()])
B_ele = np.array(B_ele)
C_ele = A_ele.dot(B_ele)

for i in range(ele[0]):
    print(' '.join(map(str,C_ele[i])))


### FIXED CODE ###

# -*- coding: utf-8 -*-
A_ele = []
B_ele = []
C_ele = []
ele = [int(x) for x in input().split()]
for i in range(ele[0]):
    A_ele.append([int(x) for x in input().split()])
for i in range(ele[1]):
    B_ele.append([int(x) for x in input().split()])
for i in range(ele[0]):
    C_ele.append([])
    for j in range(ele[1]):
        for k in range(ele[2]):
            if j == 0:
                C_ele[i].append(0)
            C_ele[i][k] = C_ele[i][k] + A_ele[i][j] * B_ele[j][k]
for i in range(ele[0]):
    print(' '.join(map(str,C_ele[i])))
n = int(input())
def cnt(x):
	return sum(1 for i in range(1, x+1) if x%i == 0)
print(sum(1 for i in range(1, n+1, 2) if cnt(i) == 8))

### FIXED CODE ###

a, b = map(int, input().split())
print((a-1)*(b-1))
a = int(input())
n = int(input())
if a >=　(n % 500):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n=int(input())%500
a=int(input())
print('Yes' if a>=n else 'No')
n,m=map(int, input().split())
e=[[] for _ in range(n)]
e_rev=[[] for _ in range(n)]
for i in range(m):
    ai,bi=map(int, input().split())
    e[ai].append(bi)
    e_rev[bi].append(ai)

p_ord=[]
used=[0]*n
def dfs(v):
    used[v]=1
    for u in e[v]:
        if not used[u]:
            dfs(u)
    p_ord.append(v)
for i in range(n):
    if not used[i]:
        dfs(i)
compo = [0]*n
used=[0]*n
def dfs_rev(v,c):
    compo[v]=c
    used[v]=1
    for u in e_rev[v]:
        if not used[u]:
            dfs_rev(u,c)
cnt=0
for i in reversed(p_ord):
    if not used[i]:
        dfs_rev(i,cnt)
        cnt+=1
cc=[[] for _ in range(cnt+1)]
for i in range(n):
    cc[compo[i]].append(i)

print(len([cci for cci in cc if cci]))
for cci in cc:
    if cci:
        print(len(cci),*cci)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
n,m=map(int, input().split())
e=[[] for _ in range(n)]
e_rev=[[] for _ in range(n)]
for i in range(m):
    ai,bi=map(int, input().split())
    e[ai].append(bi)
    e_rev[bi].append(ai)

p_ord=[]
used=[0]*n
def dfs(v):
    used[v]=1
    for u in e[v]:
        if not used[u]:
            dfs(u)
    p_ord.append(v)
for i in range(n):
    if not used[i]:
        dfs(i)
compo = [0]*n
used=[0]*n
def dfs_rev(v,c):
    compo[v]=c
    used[v]=1
    for u in e_rev[v]:
        if not used[u]:
            dfs_rev(u,c)
cnt=0
for i in reversed(p_ord):
    if not used[i]:
        dfs_rev(i,cnt)
        cnt+=1
cc=[[] for _ in range(cnt+1)]
for i in range(n):
    cc[compo[i]].append(i)

print(len([cci for cci in cc if cci]))
for cci in cc:
    if cci:
        print(len(cci),*cci)
nums= input().split()


for i in range(len(nums)):
    nums[i] = int(nums[i])
    
nums.sort()


if nums[1] == nums[2] and nums[0]<nums[1]:
    print(Yes)
elif nums[1] == nums[0] and nums[1]<nums[2]:
    print(Yes)
else:
    print(No)

### FIXED CODE ###

nums= input().split()


for i in range(len(nums)):
    nums[i] = int(nums[i])
    
nums.sort()


if nums[1] == nums[2] and nums[0]<nums[1]:
    print("Yes")
elif nums[1] == nums[0] and nums[1]<nums[2]:
    print("Yes")
else:
    print("No")
print(B*((T+0.5)//A))

### FIXED CODE ###

A, B, T = map(int, input().split())
print(B*(T//A))
n,m,x=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
ans=0
for i in range(m):
  ans+=1 if a[i]<x
print(min(ans,m-ans))

### FIXED CODE ###

n,m,x=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
ans=0
for i in range(m):
  ans=ans+1 if a[i]<x else ans
print(min(ans,m-ans))
N, Q =  map(int, (input().split(' ')))
S = str(input())
lr = [tuple(map(int, input().split(' '))) for _ in range(Q)]
save = [0] * N
print(N)
print(Q)
print(S)
i = 0
while i < len(S):
    if S[i] == "A":
        if S[i+1] == "C":
            save[i] = 1
        i += 1
    elif S[i] == "C":
        i += 1
    else:
        i+=1

for left, right in lr:
    print(sum(save[left-1: right-1]))





### FIXED CODE ###

N, Q =  map(int, (input().split(' ')))
S = ' '+str(input())
lr = [tuple(map(int, input().split(' '))) for _ in range(Q)]
save = ''
#i = 0
class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)
 
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s
 
    def add(self, h, x):
        while h <= self.size:
            self.tree[h] += x
            h += h & -h

bit = Bit(N)     # 要素数を与えてインスタンス化
i = 1
while i < len(S)-1:
    if S[i] == "A":
        if S[i+1] == "C":
            bit.add(i, 1)    # a2に10を加える
        else:
            pass
    i += 1

for left, right in lr:
    print(bit.sum(right-1) - bit.sum(left-1)) # a1～a6の合計を返す => 9
from collections import deque

S = deque(input())
Q = int(input())
Queries = [input().split() for _ in range(Q)]

need_reverse = False

for q in Queries:
    if q[0] == "1":
        need_reverse = not need_reverse
    else:
        if q[1] == "1":
            if not need_reverse:
                S.appendleft(q[2])
            else:
                S.append(q[2])
        else:
            if not need_reverse:
                S.append(q[2])
            else:
                S.appendleft(q[2])

print(S if not need_reverse else S[::-1])


### FIXED CODE ###

from collections import deque

S = deque(input())
Q = int(input())

reverse = False
cnt = 0
for i in range(Q):
    inp = input().split()
    if inp[0] == "1":
        cnt += 1
        reverse = (cnt % 2 != 0)
        #S = S[::-1]
    else:
        f, c = inp[1:]
        if int(f) == 1:
            if reverse:
                S.append(c)
            else:
                S.appendleft(c)
        else:
            if reverse:
                S.appendleft(c)
            else:
                S.append(c)
S = "".join(S)
print(S[::-1] if reverse else S)
def my_index(l, x, default=0):
    if x in l:
        return l.index(x)
    else:
        return default


T=list("keyence")
x=0
j=0
S=input()
#print(my_index(S,"k"))
if my_index(S,"k")==0:
  for i in range(len(S)):
    if S[i]==T[j]:
      x=x+1
      #print(x)
      j=j+1
    else:
      #print("c")
      continue
  if x==7:
    print("YES")
  else:
    print("NO")    
else:
  for i in range(int(my_index(S,"k")),len(S)):
    if S[i]==T[j] and int(my_index(S,"k"))+7==len(S):
      x=x+1
      #print(x,i)
      j=j+1
    else:
      break
  if x==7 and int(my_index(S,"k"))+7==len(S):
    print("YES")
  else:
    print("NO")

### FIXED CODE ###

A=["k","e","y","e","n","c","e"]
f=-1;p=0;q=0;r=0
S=list(map(str,input()))
if S[0:7]==A or S[len(S)-7:len(S)]==A:
  f=1
else:
  if S[0]!=A[0]:
    f=0
  else:    
    for i in range(len(S)):
      if S[i]==A[i]:
        p=p+1
      else:
        if A[0:p]+S[len(S)-(len(A)-p):len(S)]==A:
          #print(A[0:p]+S[len(S)-(len(A)-p):len(S)])
          f=1
          break
        else:
          f=0
          break
print("YES" if f==1 else "NO")
n = list[input().split()]
m = sorted(n)
print(m[0]+m[1])

### FIXED CODE ###

n = list(map(int,input().split()))
m = sorted(n)
print(m[0]+m[1])
n, m =map(int,input().split())
c = list(map(int,input().split()))

INF = 10**10
dp = [INF]*50000
dp[0] = 0

for i in range (n+1):
    for j in c:
        dp[i+j] = min(dp[i+j],dp[i]+1)
print(dp[n])


### FIXED CODE ###

n, m =map(int,input().split())
c = list(map(int,input().split()))

INF = 10**100
dp = [INF]*500000
dp[0] = 0

for i in range (n+1):
    for j in c:
        dp[i+j] = min(dp[i+j],dp[i]+1)
print(dp[n])
n = int(input())
note = dict()
for i in range(n):
    s = "".join(sorted(input()))
    if s in note.keys():
        note[s] += 1
    else:
        note[s] = 1
        
import collections
c = collections.deque(note.values())
ans = 0
for i in range(c):
    q = c.popleft()
    ans += q*(q-1)//2

print(ans)

### FIXED CODE ###

import sys
#input = sys.stdin.readline

n = int(input())
note = dict()
ans = 0
for i in range(n):
    s = "".join(sorted(sys.stdin.readline()))
    if s in note.keys():
        ans += note[s]
        note[s] += 1
    else:
        note[s] = 1

print(ans)
istNK = list(map(int,input().split()))
S = list(input())

if S[listNK[1]-1]=="A":
    S[listNK[1]-1] = "a"
if S[listNK[1]-1]=="B":
    S[listNK[1]-1] = "b"
if S[listNK[1]-1]=="C":
    S[listNK[1]-1] = "c"

output = ""
for i in range(listNK[0]):
    output = output + S[i]

print(output)

### FIXED CODE ###

listNK = list(map(int,input().split()))
S = list(input())

if S[listNK[1]-1]=="A":
    S[listNK[1]-1] = "a"
if S[listNK[1]-1]=="B":
    S[listNK[1]-1] = "b"
if S[listNK[1]-1]=="C":
    S[listNK[1]-1] = "c"

output = ""
for i in range(listNK[0]):
    output = output + S[i]

print(output)
import sys
sys.setrecursionlimit(10000)


n, q = map(int, input().split())
adj = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    adj[a].append(b)
    adj[b].append(a)

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

parent = [0] * n
res = [0] * n
visited = [False] * n
def dfs(x, n):
    res[x] += n
    visited[x] = True
    for ne in adj[x]:
        if not visited[ne]:
            dfs(ne, n + p[ne])

dfs(0, p[0])
print(' '.join([str(x) for x in res]))



### FIXED CODE ###

import sys

n, q = map(int, input().split())
adj = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    adj[a].append(b)

res = [0] * n
for _ in range(q):
    i, x = map(int, input().split())
    res[i-1] += x

parent = [0] * n
stack = [0]
while len(stack) > 0:
    i = stack.pop()
    for j in adj[i]:
        res[j] += res[i]
        stack.append(j)

print(' '.join([str(x) for x in res]))
from sys import stdin

ans = []


def problem_a(input_string):
    S = int(input_string[0].rstrip())
    N = input_string[1].rstrip()
    #print(S, N)

    #% (10^9 + 7)
    #return count_0
    N_l = len(N)
    for i in range(N_l):
        b(N, N[i], i)
    #print(list(set(ans)))
    #print(10**9 + 7)

    # 2
    #return len(list(set(ans))) % (10**9 + 7)
    for i in range(N_l):
        ans.append(N[i])
    #print(ans)
    return len(ans) % (10**9 + 7)


def b(org_array, temp, i):
    if len(org_array)-1 == i:
        return
    else:
        #print("org array:"+org_array)
        #ans.append(temp)
        #print(temp)
        if org_array[i+1] not in temp:
            b(org_array, temp, i+1)
            temp += org_array[i+1]
            ans.append(temp)
        #print("org: "+org_array[i+1])
        #print(temp)
        b(org_array, temp, i+1)


def main():
    input_line = stdin.readlines()
    answer = problem_a(input_line)
    print(answer)


if __name__ == '__main__':
    main()


### FIXED CODE ###

from sys import stdin
import math
import itertools


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

# これだと、O(n*n)
"""
temp_ans = []


def problem_a(input_string):
    S = int(input_string[0].rstrip())
    N = input_string[1].rstrip()
    N_l = len(N)
    global temp_ans
    for i in range(N_l)[::-1]:
        temp_ans += N[i]
        #print(temp_ans)
        for s in temp_ans:
            #print(s)
            if N[i] not in s:
                temp_ans.append(N[i]+s)
    #print(temp_ans)
    return len(temp_ans) % (10**9 + 7)
"""


def problem_a(input_string):
    S = int(input_string[0].rstrip())
    N = input_string[1].rstrip()
    #print(S)
    dic = {}
    c = 0
    for i in range(S)[::-1]:
        if N[i] not in dic:
            dic[N[i]] = 1
            #c += i+1
        else:
            dic[N[i]] += 1

    c = 1
    for key, value in dic.items():
        c *= (value+1)
    c -= 1
    """
    c += 2**len(dic.keys())-1
    #print(c)
    #c += S
    for key, value in dic.items():
        if value > 1:
            #c -= (value-1)
            c += 2**(len(dic.keys()))-1
            #print(c)
    #for key, value in dic.items():
    for key, value in dic.items():
        if value > 1:
            if len(dic.keys()) != S:
                c -= 2**(S-len(dic.keys())-1)
    """
            #print(c)
        #else:
    #c += (S-len(dic.keys()))
    """
    s_N = sorted(N)
    for i in range(S-1):
        if s_N[i] != s_N[i+1]:
            c += 2**(i+2)
    """
    """
    for key, value in dic.items():
        if value > 1:
            c += 2**(len(dic.items())-value)
        else:
            c += 2**(len(dic.items())-value)
    """
    #combinations_count(len(, r)

    return c % (10**9 + 7)


def main():
    input_line = stdin.readlines()
    answer = problem_a(input_line)
    print(answer)


if __name__ == '__main__':
    main()
import math

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

def lcm(x,y):
    z = int(x*y/math.gcd(x,y))
    return z
    
print(lcm(a,b))

### FIXED CODE ###

import fractions

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

def lcm(x,y):
    z = int(x*y/fractions.gcd(x,y))
    return z
    
print(lcm(a,b))
num = 1
num1 = 0
N = int(input())
H = list(map(int, input.split())
for i in range(1,N):
  if H[i] >= H[i-1]:
    num += 1
  else :
    num1 += 1
print(a)
         

### FIXED CODE ###

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

cnt = 0
for i in range(len(H)):
    if (max(H[0:i+1]) == H[i]):
        cnt += 1

print(cnt)
for i in string:
    sum_of_win = 1
    if i == 'o':
        sum_of_win += 1
    if i == 'x':
        sum_of_win -= 1
if sum_of_win >= 0:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

string = input()
sum_of_o = 0
for i in string:
    if i == 'o':
        sum_of_o += 1
 
if 15-len(string) >= 8 - sum_of_o:
    print("YES")
else:
    print("NO")
from math import gcd
from functools import reduce

k = int(input())
li = []
for a in range(1,k+1):
  for b in range(1,k+1):
    for c in range(1,k+1):
      li.append(func(a,b,c))

print(sum(li))

### FIXED CODE ###

from math import gcd
from functools import reduce

def func(a,b,c):
  if a == b and b == c:
    return a
  elif a == b and b !=c:
    return gcd(a,c)
  elif a != b and b ==c:
    return gcd(a,b)
  else:
    return reduce(gcd,(a,b,c))

k = int(input())
li = []
for a in range(1,k+1):
  for b in range(1,k+1):
    for c in range(1,k+1):
      li.append(func(a,b,c))

print(sum(li))
# https://atcoder.jp/contests/agc034/tasks/agc034_a

import sys
# sys.setrecursionlimit(100000)


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


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n, a, b, c, d = input_int_list()
    S = input()

    for i in range(a - 1, max(c, d) - 1):
        if S[i] == S[i + 1] == "#":
            print("No")
            quit()
    if c < d:
        print("Yes")
        quit()
    if c > d:
        for i in range(b - 2, d - 1):
            if S[i, i + 3] == "...":
                print("Yes")
                quit()
        print("No")
        quit()


if __name__ == "__main__":
    main()


### FIXED CODE ###

# https://atcoder.jp/contests/agc034/tasks/agc034_a

import sys
# sys.setrecursionlimit(100000)


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


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n, a, b, c, d = input_int_list()
    S = input()

    for i in range(a - 1, max(c, d) - 1):
        if S[i] == S[i + 1] == "#":
            print("No")
            quit()
    if c < d:
        print("Yes")
        quit()
    if c > d:
        for i in range(b - 2, d - 1):
            if S[i: i + 3] == "...":
                print("Yes")
                quit()
        print("No")
        quit()


if __name__ == "__main__":
    main()
while True:
  H, W = map(int, raw_input().spslit())
  if H = 0 and 'W' = 0:
    break
  print '#'*W
  for l in range(0, H-2):
    print '#' + '.'*(W-2) + '#'
  print '#' * W
  print ''

### FIXED CODE ###

while True:
  H, W = map(int, raw_input().split())
  if H == 0 and W == 0:
    break
  print '#'*W
  for l in range(0, H-2):
    print '#' + (W-2)*'.' + '#'
  print '#' * W
  print ''
n, m = [int(i) for i in input().split()]
a = [-1]

MAX = 100000
MOD = 1000000007
fac = [1 for i in range(MAX)]
finv = [1 for i in range(MAX)]
inv = [1 for i in range(MAX)]
for i in range(2, MAX):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD
    finv[i] = finv[i - 1] * inv[i] % MOD

def COM(n , r):
    if n < r:
        return 0
    if n < 0 or r < 0:
        return 0
    return fac[n] * (finv[r]* finv[n-r]%MOD)%MOD

for mi in range(m):
    a.append(int(input()))
a.append(n+1)

ans = 1
for mi in range(1, m+2):
    if a[mi] == a[mi-1]:
        break
    elif a[mi] == a[mi-1] + 1:
        ans = 0
        break
    k = a[mi] - a[mi-1] - 2
    max_2 = k//2
    cnt = 0
    for i in range(max_2+1):
        cnt += COM(k-i, i)
    ans = ans * cnt % 1000000007
    if ans == 0:
        break

print(int(ans))


### FIXED CODE ###

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

b = [0 for i in range(n+1)]

for mi in range(m):
    b[int(input())] = 1
cnt = 0
s = [0 for i in range(n+1)]
s[0] = 1
if b[1] == 0:
    s[1] = 1
else:
    s[1] = 0
for ni in range(2,n+1):
    if b[ni] == 0:
        s[ni] = (s[ni-1] + s[ni-2]) % 1000000007
    else:
        s[ni] = 0
print(s[n])
a , b = input().split()
if a+b >= 24:
	print ((a + b) - 24)
else:
  	print (a + b)

### FIXED CODE ###

a , b = map(int, input().split())
if a+b >= 24:
	print ((a + b) - 24)
else:
  	print (a + b)
import math
A,B = map(int,input().split())
print(int((A*B)/math.gcd(A,B)))

### FIXED CODE ###

import fractions
A,B = map(int,input().split())
print(int((A*B)/fractions.gcd(A,B)))
n,m=map(int,input().split())
if m%i==0:
    ans=m//i
else:
    ans=m//i-1
print(ans)

### FIXED CODE ###

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

n,m=map(int,input().split())
l=make_divisors(m)
for i in l:
    if n<=i:
        ans=m//i
        break
print(ans)
n, m = map(int, input().split())
p = list(map(int, input().split()))
uf = [i for i in range(n + 1)]

def dfs(x):
    if uf[x] == x:
        return x
    return dfs(uf[x])

for _ in range(m):
    xy = list(map(int, input().split()))
    rx, ry = dfs(xy[0]), dfs(xy[1])
    if rx != ry:
        uf[rx] = ry
count = sum([1 for i in range(n) if p[i] == i + 1 or dfs(i + 1) == dfs(p[i])])
print(count)

### FIXED CODE ###

n, m = map(int, input().split())
p = list(map(int, input().split()))
xys = [list(map(int, input().split())) for _ in range(m)]
mapp = [[] for _ in range(n + 1)]
for xy in xys:
    mapp[xy[0]].append(xy[1])
    mapp[xy[1]].append(xy[0])

bfs = [0] * (n + 1)
count = 0
for i in range(1, n + 1):
    nexts = mapp[i]
    if not(bfs[i]):
        bfs[i] = i
    for j in nexts:
        if bfs[j]:
            continue
        bfs[j] = i
        nexts += mapp[j]
    if bfs[i] == bfs[p[i - 1]]:
        count += 1
print(count)
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    n, k, s, t = nm()
    a = [x ^ s for x in nl() if x & s == s and x | t == t]
    n = len(a)
    t ^= s
    s = 0

    C = [[0]*(n+1) for i in range(n+1)]
    for i in range(n+1):
        for j in range(i+1):
            if j == 0:
                C[i][j] = 1
            elif i > 0:
                C[i][j] = C[i-1][j] + C[i-1][j-1]
    D = [0]*(n+1)
    for i in range(n+1):
        for j in range(1, k+1):
            D[i] += C[i][j]
    for i in range(n, 0, -1):
        D[i] -= D[i-1]
    l = list()
    for i in range(20, -1, -1):
        if t & (1 << i):
            l.append(i)
    p = len(l)
    na = list()
    for x in a:
        v = 0
        for i in l:
            v = v << 1 | x >> i & 1
        na.append(v)
    pc = [0]*(1 << p)
    for bit in range(1 << p):
        for i in range(p):
            if not bit & (1 << i):
                pc[bit | (1 << i)] = pc[bit] + 1
    return
    l = [0]*(1 << p)
    ans = 0
    for bit in range(1 << p):
        cur = 0
        for x in na:
            l[bit&x] += 1
            cur += D[l[bit&x]]
        for x in na:
            l[bit&x] -= 1
        if pc[bit] & 1:
            ans -= cur
        else:
            ans += cur
    print(ans)
    return

solve()


### FIXED CODE ###

import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def popcount(x):
    x = x - ((x >> 1) & 0x55555555)
    x = (x & 0x33333333) + ((x >> 2) & 0x33333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    return x & 0x0000007f


def solve():
    n, k, s, t = nm()
    a = [x ^ s for x in nl() if x & s == s and x | t == t]
    n = len(a)
    t ^= s
    s = 0
    C = [[0]*(n+1) for i in range(n+1)]
    for i in range(n+1):
        for j in range(i+1):
            if j == 0:
                C[i][j] = 1
            elif i > 0:
                C[i][j] = C[i-1][j] + C[i-1][j-1]
    D = [0]*(n+1)
    for i in range(n+1):
        for j in range(1, min(k, n)+1):
            D[i] += C[i][j]
    for i in range(n, 0, -1):
        D[i] -= D[i-1]
    l = list()
    for i in range(20, -1, -1):
        if t & (1 << i):
            l.append(i)
    p = len(l)
    na = list()
    for x in a:
        v = 0
        for i in l:
            v = v << 1 | x >> i & 1
        na.append(v)
    pc = [popcount(i) for i in range(1 << p)]
    l = [0]*(1 << p)
    ans = 0
    for bit in range(1 << p):
        cur = 0
        for x in na:
            l[bit&x] += 1
            cur += D[l[bit&x]]
        for x in na:
            l[bit&x] -= 1
        if pc[bit] & 1:
            ans -= cur
        else:
            ans += cur
    print(ans)
    return

solve()
a = int(raw_input())
b = int(raw_input())

if a == 1:
	a = a + 13

if b == 1:
	b = b + 13

if a > b:
	print("Alice")
elif a < b:
	print("Bob")
else:
	print("Draw")


### FIXED CODE ###

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

if a == 1:
	a = 14

if b == 1:
	b = 14

if a > b:
	print "Alice"
elif a < b:
	print "Bob"
else:
	print "Draw"
import sys
import math
A, B = map(int, input().split())
if A == B:
  print (A)
  sys.exit()

def xor(a, b):
  r = ""
  for i in range(len(a)):
    if a[i] == "0" and b[i] == "0" or a[i] == "1" and b[i] == "1":
      r += "0"
    else:
      r += "1"
  return r

S = "0" * 50
def xorn(S, n):
  m = int(math.log2(n))
  b = n - 2 ** m
#  print (S[0:-m-1],1,S[-m-1:-1],m,b)
  S = S[0:-m-1] + "1" + S[-m-1:-1]
  if b == 0:
    return S
  return xorn(S, b)

s = int("0b" + xor(xorn(S, A-1), xorn(S, B)), 0)
print (s+1 if (B-A) % 2 == 1 else s)

### FIXED CODE ###

import sys
import math
A, B = map(int, input().split())

def nXor(n):
  if n % 2 == 0:
    if (n//2) % 2 == 0:
      return 0 ^ n
    else:
      return 1 ^ n
  else:
    if ((n+1)//2) % 2 == 0:
      return 0
    else:
      return 1
n = 0
for i in range(9):
  n = n^i
print (nXor(A-1) ^ nXor(B))