Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

h,w=map(int,input().split())
M=[list(input()) for i in range(h)]
D=[[0]*w for i in range(h)]
U=[[0]*w for i in range(h)]
R=[[0]*w for i in range(h)]
L=[[0]*w for i in range(h)]

for i in range(h):
    c=0
    for j in range(w):
        if M[i][j]=='.':
            c+=1
            R[i][j]=c
        else:
            c=0
for i in range(h):
    c=0
    for j in range(w):
        if M[i][w-1-j]=='.':
            c+=1
            L[i][w-1-j]=c
        else:
            c=0
for j in range(w):
    c=0
    for i in range(h):
        if M[i][j]=='.':
            c+=1
            D[i][j]=c
        else:
            c=0
for j in range(w):
    c=0
    for i in range(h):
        if M[h-1-i][j]=='.':
            c+=1
            U[h-1-i][j]=c
        else:
            c=0
r=0
for i in range(h):
    for j in range(w):
        r=max(r,R[i][j]+L[i][j]+D[i][j]+U[i][j]-3)
print(r)

### FIXED CODE ###

h,w=map(int,input().split())
M=[list(input()) for i in range(h)]
D=[[0]*w for i in range(h)]
U=[[0]*w for i in range(h)]
R=[[0]*w for i in range(h)]
L=[[0]*w for i in range(h)]

for i in range(h):
    c=0
    for j in range(w):
        if M[i][j]=='.':
            c+=1
            R[i][j]=c
        else:
            c=0
for i in range(h):
    c=0
    for j in range(w):
        if M[i][w-1-j]=='.':
            c+=1
            L[i][w-1-j]=c
        else:
            c=0
for j in range(w):
    c=0
    for i in range(h):
        if M[i][j]=='.':
            c+=1
            D[i][j]=c
        else:
            c=0
for j in range(w):
    c=0
    for i in range(h):
        if M[h-1-i][j]=='.':
            c+=1
            U[h-1-i][j]=c
        else:
            c=0
r=0
for i in range(h):
    for j in range(w):
        r=max(r,R[i][j]+L[i][j]+D[i][j]+U[i][j]-3)
print(r)
### BUGGY CODE ###

import numpy as np
N,Y = map(int,input().split())
satu = np.array([10000,5000,1000])
lst = []
flag = True
for i in range(N+1):
    for j in range(N+1):
        if(N-i-j)>=0:
            lst.append(np.array([i,j,N-i-j]))
for i in range(len(lst)):
    gaku = np.dot(satu,lst[i])
    if gaku == Y:
        print(lst[i][0],lst[i][1],lst[i][2])
        #print("{} {} {}".format(lst[i]))
        flag = False
        break
if flag:
    print("-1 -1 -1")


### FIXED CODE ###

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

satu = [1000,5000,10000]

sen = [1000 * i for i in range(n+1)]
gsen = [5000 * i for i in range(n+1)]
man = [10000 * i for i in range(n+1)]

#print(sen,gsen,man)
for i in range(n+1):
    for j in range(n+1-i):
        if man[i]+ gsen[j] + sen[n-i-j] == y:
            print(i,j,n-i-j)
            exit()

print("-1 -1 -1")
### BUGGY CODE ###

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

kouho = set()
done = set()


def f(t):
    x, y, z = t
    return A[x] + B[y] + C[z]


def main():
    kouho.add((0, 0, 0))

    for k in range(K):
        temp = 0
        for d in kouho:
            if d in done:
                continue
            if f(d) > temp:
                todel = d
                temp = f(d)

        x, y, z = todel
        toadd = [(x, y, z+1), (x, y+1, z), (x+1, y, z)]
        for ta in toadd:
            if ta[0] == X:
                continue
            if ta[1] == Y:
                continue
            if ta[2] == Z:
                continue
            if ta in kouho:
                continue
            kouho.add(ta)

        done.add(todel)
        print(temp)


if __name__ == '__main__':
    main()


### FIXED CODE ###

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

kouho = set()
done = set()


def f(t):
    x, y, z = t
    if x >= X or y >= Y or z >= Z:
        return 0
    return A[x] + B[y] + C[z]


def main():
    start = (f((0, 0, 0)), (0, 0, 0))
    kouho.add(start)
    done.add(start)

    for k in range(K):
        d = max(kouho)
        kouho.remove(d)

        x, y, z = d[1]
        toadd = [(x, y, z+1), (x, y+1, z), (x+1, y, z)]
        for ta in toadd:
            t = (f(ta), ta)
            if t in done:
                continue
            kouho.add(t)
            done.add(t)

        print(d[0])


if __name__ == '__main__':
    main()
### BUGGY CODE ###

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

cost = [0 for i in range(N)]
cost[0] = 0

for i in range(1,N):
    for j in range(1,K+1):
        if i-j<0:
            break
        #print(i,j)
        if j==1:
            cost_min = abs(h[i]-h[i-j]) + cost[i-j]
        else:
            cost_min = min(cost_min, abs(h[i]-h[i-j]) + cost[i-j])
    cost[i] = cost_min

print(cost[N-1])

### FIXED CODE ###

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

cost = [0 for i in range(N)]
cost[0] = 0

for i in range(1,N):
    for j in range(1,K+1):
        if i-j<0:
            break
        #print(i,j)
        if j==1:
            cost_min = abs(h[i]-h[i-j]) + cost[i-j]
        else:
            cost_min = min(cost_min, abs(h[i]-h[i-j]) + cost[i-j])
    cost[i] = cost_min

print(cost[N-1])
### BUGGY CODE ###

S = input()
lS = len(S)
f = ""
ans = "YES"
i = 0
while(i < lS):
    tmp = S[i:i+5]
    if (tmp == "erase"):
        f = "r"
        i += 5
        continue
    if (tmp == "dream"):
        f = "er"
        i += 5
        continue
    if (f == ""):
        ans = "NO"
        break
    tmp = S[i:i+len(f)]
    if (tmp == f):
        i += len(f)
        f = ""

print(ans)
        


### FIXED CODE ###

S = input()
S = S[::-1]
key = [
    "dream"[::-1],
    "erase"[::-1],
    "dreamer"[::-1],
    "eraser"[::-1]
]
f = False
while(S != ""):
    f = False
    for i in range(4):
        tmp = S[0:len(key[i])]
        if (tmp == key[i]):
            S = S[len(key[i]):]
            f = True
            break
    if not(f):
        break
        
if (f):
    print("YES")
else:
    print("NO")
### BUGGY CODE ###

S = input()
count = 0
while "ABC" in S:
    count += S.count("ABC")
    S = S.replace("ABC", "BCA")
print(count)

### FIXED CODE ###

S = input()
S = S.replace("BC","X")
count = 0
cntA = 0
for c in S:
    if c == "A":
        cntA += 1
    elif c == "X":
        count += cntA
    else:
        cntA = 0
print(count)
### BUGGY CODE ###

def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def lm(a, b):
    if a > b:
        a, b = b, a
    while b % a:
        a, b = b % a, a
    return a


def gm(a, b):
    return a // lm(a, b) * b


def main():
    mod = 10 ** 9 + 7
    N = int(input())
    A = read_list()

    l = 1
    res = 0
    for a in A:
        if l % a == 0:
            res = (res + l // a) % mod
        else:
            l2 = gm(a, l)
            res = (res * l2 // l) % mod
            res = (res + l2 // a) % mod
            l = l2
    print(res)


if __name__ == "__main__":
    main()



### FIXED CODE ###

def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def g(a, b):
    if a > b:
        a, b = b, a
    while b % a:
        a, b = b % a, a
    return a


def main():
    mod = 10 ** 9 + 7
    N = int(input())
    A = read_list()

    B = 1
    for a in A:
        B *= a // g(B, a)
    
    print(sum(B // a for a in A) % mod)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

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

ans = 0
for i in range(N):
    Q = P[0 : i+1]
    if min(Q) == Q[-1]:
        ans += 1

print(ans)

### FIXED CODE ###

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

tmp = P[0]
ans = 0

for i in P:
    if i <= tmp:
        ans += 1
        tmp = i
        
print(ans)
### BUGGY CODE ###

import bisect
n=int(input())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
A.sort()
B.sort()
C.sort()
ans=0
for a in A:
    idx = bisect.bisect_right(B,a)
    for b in B[idx:]:
        idx2 = bisect.bisect_right(C,b)
        #print(idx,idx2)
        ans += (n-idx2)
print(ans)

### FIXED CODE ###

import bisect
n=int(input())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
C=[-int(i) for i in input().split()]
A.sort()
B.sort()
C.sort()
ans = 0
for b in B:
    a = bisect.bisect_left(A,b)
    c = bisect.bisect_left(C,-b)
    #print(a,c)
    ans += a*c
print(ans)
### BUGGY CODE ###

def main():
    import sys
    input = sys.stdin.readline
    N = int(input())
    A = tuple(map(int, input().split()))

    I = 0
    J = 0
    K = 0
    for a in A:
        if a == 1:
            I += 1
        elif a == 2:
            J += 1
        else:
            K += 1

    dp = [[[0] * (N + 1) for _ in range(N + 1)] for _ in range(N + 1)] 

    # def output(lst):
    #     for tmp in lst:
    #         print (tmp)

    for k in range(K + 1):
        for j in range(K + J + 1):
            for i in range(N + 1):
                if i == j == k == 0:
                    continue
                tmp = N
                if i > 0:
                    tmp += i * dp[k][j][i - 1]
                if j > 0 and i < N:
                    tmp += j * dp[k][j - 1][i + 1]
                if k > 0 and j < K + J:
                    tmp += k * dp[k - 1][j + 1][i]
                dp[k][j][i] = tmp / (i + j + k)

    print (dp[K][J][I])

    # output(dp)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    import sys
    input = sys.stdin.readline
    N = int(input())
    A = tuple(map(int, input().split()))

    I = A.count(1)
    J = A.count(2)
    K = A.count(3)
    # for a in A:
    #     if a == 1:
    #         I += 1
    #     elif a == 2:
    #         J += 1
    #     else:
    #         K += 1

    dp = [[[0] * (N + 1) for _ in range(N + 1)] for _ in range(N + 1)] 

    # def output(lst):
    #     for tmp in lst:
    #         print (tmp)

    for k in range(K + 1):
        for j in range(K + J + 1 - k):
            for i in range(N + 1 - k  - j):
                if i == j == k == 0:
                    continue
                tmp = N
                if i > 0:
                    tmp += i * dp[k][j][i - 1]
                if j > 0:
                    tmp += j * dp[k][j - 1][i + 1]
                if k > 0:
                    tmp += k * dp[k - 1][j + 1][i]
                dp[k][j][i] = tmp / (i + j + k)

    print (dp[K][J][I])

    # output(dp)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

import numpy as np
N,M,K = list(map(int,input().split()))
A = np.array(list(map(int,input().split())))
B = np.array(list(map(int,input().split())))

sum_A = sum(A)
sum_B = sum(B)
if sum_A > K: # 時間を超過する場合
    tmp_cnt = 0
    for i,a in enumerate(A):
        tmp_cnt += a
        if tmp_cnt > K:
            break
    A_n_max = i
else: #時間を超過しない場合
    A_n_max = len(A)
    
cnt = 0
best_cnt = 0
b_start=0
for a_sub_i in range(A_n_max):
    cnt = A_n_max - a_sub_i
    time_left = K - A[:(A_n_max - a_sub_i)].sum()
   # print(a_sub_i)
   # print(time_left)
    for b_j in range(b_start, len(B)):
      #  print(b_j)
        if (time_left - B[:(b_j+1)].sum()) < 0:
            cnt = cnt + b_j
    #        print(f"b done {b_j}")
            break
        if b_j == (len(B)-1):
            cnt = cnt + b_j +1
     #       print(f"b done__ {b_j}")
            break
    b_start = b_j        
    if cnt > best_cnt:
        best_cnt = cnt
        
print(best_cnt)

### FIXED CODE ###

N, M, K = list(map(int, input().split()))
A = [0] + [int(i) for i in input().split() ]
B = [0] + [int(i) for i in input().split() ]

best = 0
a_time = 0
b_time = sum(B)
b_i = len(B)-1
end_flag = False
for a_i in range(N+1):
    a_time += A[a_i]
    while a_time + b_time > K:
        if b_i == 0:
            end_flag = True
            break
        b_time -= B[b_i]
        b_i -= 1

    if end_flag == True:
        break
    if a_i + b_i > best:
        best = a_i + b_i

print(best)
### BUGGY CODE ###

s = list(input())
K = int(input())

l =[]

for i in range(len(s)):
    tmp = ''
    for j in range(i, len(s)):
        if j > i + 4: break
        tmp += s[j]
        l.append(tmp)
l.sort()

l2 = []
for x in l:
    if x not in l2:
        l2.append(x)

ans = l2[K - 1]

print(ans)


### FIXED CODE ###

s = list(input())
K = int(input())

l =[]

for i in range(len(s)):
    tmp = ''
    for j in range(i, len(s)):
        if j > i + 4: break
        tmp += s[j]
        l.append(tmp)
l.sort()

l2 = []
for x in l:
    if len(l2) > 6:
        break
    if x not in l2:
        l2.append(x)


ans = l2[K - 1]

print(ans)
### BUGGY CODE ###

N,W=map(int,input().split())
wv=[list(map(int,input().split())) for _ in range(N)]
dp=[[0]*(W+1)for _ in range(N+1)]
for n in range(1,N+1):
    for w in range(1,W+1):
        if w<wv[n-1][0]:
            dp[n][w]=dp[n-1][w]
        else:
            dp[n][w]=max(dp[n-1][w],dp[n-1][w-wv[n-1][0]]+wv[n-1][1])

print(dp[N][W])

### FIXED CODE ###

def opt(N,W):
    dp=[0]*(W+1)
    for _ in range(N):
        w,v=map(int,input().split())
        for i in range(W,w-1,-1):
            tmp=dp[i-w]+v
            if tmp>dp[i]:
                dp[i]=tmp
    print(dp[W])

N,W=map(int,input().split())
opt(N,W)
### BUGGY CODE ###

def base10toN(num, base):
    converted_string, modstring = "", ""
    currentnum = num
    if not num:
        return '0'
    while currentnum:
        mod = currentnum % base
        currentnum = currentnum // base
        converted_string = chr(48 + mod + 7*(mod > 10)) + converted_string
    return converted_string
n=int(input())
pop=[0]*(2*10**5+1)
for i in range(1,2*10**5+1):
  temp=base10toN(i,2)
  ans=0
  for j in range(len(temp)):
    if temp[j]=='1':
      ans+=1
  r=i%ans
  pop[i]=pop[r]+1
x=input()
ones=0
ans1=[]
for i in range(n):
  if x[i]=='1':
    ones+=1
dividemore=0
divideless=0
for i in range(n):
  if x[i]=='1':
    dividemore=(pow(2,n-1-i,ones+1)+dividemore)%(ones+1)
    if ones>=2:
      divideless=(pow(2,n-1-i,ones-1)+divideless)%(ones-1)
for i in range(n):
  counter=0
  if x[i]=='0':
    temp=(dividemore+pow(2,n-1-i,ones+1))%(ones+1)
  else:
    if ones==1:
      ans1.append('0')
      continue
    else:
      temp=(divideless-pow(2,n-1-i))%(ones-1)
  ans1.append(str(pop[temp]+1))
print(' '.join(ans1))
    

### FIXED CODE ###

def base10toN(num, base):
    converted_string, modstring = "", ""
    currentnum = num
    if not num:
        return '0'
    while currentnum:
        mod = currentnum % base
        currentnum = currentnum // base
        converted_string = chr(48 + mod + 7*(mod > 10)) + converted_string
    return converted_string
n=int(input())
pop=[0]*(2*10**5+1)
for i in range(1,2*10**5+1):
  temp=base10toN(i,2)
  ans=0
  for j in range(len(temp)):
    if temp[j]=='1':
      ans+=1
  r=i%ans
  pop[i]=pop[r]+1
x=input()
ones=0
ans1=[]
for i in range(n):
  if x[i]=='1':
    ones+=1
dividemore=0
divideless=0
for i in range(n):
  if x[i]=='1':
    dividemore=(pow(2,n-1-i,ones+1)+dividemore)%(ones+1)
    if ones>=2:
      divideless=(pow(2,n-1-i,ones-1)+divideless)%(ones-1)
for i in range(n):
  counter=0
  if x[i]=='0':
    temp=(dividemore+pow(2,n-1-i,ones+1))%(ones+1)
  else:
    if ones==1:
      ans1.append('0')
      continue
    else:
      temp=(divideless-pow(2,n-1-i,ones-1))%(ones-1)
  ans1.append(str(pop[temp]+1))
print(' '.join(ans1))
### BUGGY CODE ###

s = input().strip()
k = int(input())

subset = set()
for i in range(len(s)):
    for j in range(i+1,len(s)+1):
        subset.add(s[i:j])

subset = list(subset)
subset.sort()
print(subset[k-1])

### FIXED CODE ###

from bisect import insort
s = input().strip()
k = int(input())

sublist = []
for i in range(len(s)):
    if len(sublist)>k:
        sublist = sublist[:k]
    for j in range(i+1,len(s)+1):
        if len(sublist)>=k and sublist[k-1]<s[i:j]:
            break
        if s[i:j] not in sublist and (len(sublist)<k or sublist[k-1]>s[i:j]):
            insort(sublist,s[i:j])

print(sublist[k-1])
### BUGGY CODE ###

n, total = map(int, input().split(" "))

x = -1
y = -1
z = -1

num_max_10k = total // 10000
num_max_5k = total // 5000
num_max_1k = total // 1000

for num_10k in range (num_max_10k + 1):
    sum_10k = num_10k * 10000
    for num_5k in range(num_max_5k + 1):
        sum_5k = num_5k * 5000
        if (num_10k + num_5k >= n):
            num_1k = 0
        else:
            num_1k = n - (num_10k + num_5k)
        sum_1k = num_1k * 1000

        #print(num_10k, num_5k, num_1k, sep=" ")
        if (total == (sum_10k + sum_5k + sum_1k)
            and n == (num_10k + num_5k + num_1k)):
            x, y, z = num_10k, num_5k, num_1k

print(x, y, z, sep=" ")


### FIXED CODE ###

n, total = map(int, input().split(" "))

x = -1
y = -1
z = -1

for x_tmp in range(0, n + 1):
    for y_tmp in range(0, (n - x_tmp) + 1):
        z_tmp = n - (x_tmp + y_tmp) if n >= (x_tmp + y_tmp) else 0
        if total == (x_tmp * 10000 + y_tmp * 5000 + z_tmp * 1000):
            x, y, z = x_tmp, y_tmp, z_tmp

print(x, y, z, sep = " ")
### BUGGY CODE ###

N = int(input())
A = [int(i) for i in input().split()]
lcm = dict()
mod = 10**9+7
for a in A:
    n = 2
    while a != 1:
        c = 0
        while a % n == 0:
            a //= n
            c += 1
        if not n in lcm:
            lcm[n] = 0
        lcm[n] = max(lcm[n], c)
        n += 1
l = 1
for n in lcm.keys():
    l *= pow(n, lcm[n], mod)
l %= mod
ans = 0
for a in A:
    p = pow(a, mod-2, mod)
    ans += (l*p)
print(ans % mod)


### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
pn = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443,
      449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
lcm = dict()
mod = 10**9+7
for a in A:
    i = 0
    while a != 1 and i < len(pn):
        c = 0
        n = pn[i]
        while a % n == 0:
            a //= n
            c += 1
        if not n in lcm:
            lcm[n] = 0
        lcm[n] = max(lcm[n], c)
        i += 1
    if a != 1:
        if not a in lcm:
            lcm[a] = 1
l = 1
for n in lcm.keys():
    l *= pow(n, lcm[n], mod)
    l %= mod
ans = 0
for a in A:
    p = pow(a, mod-2, mod)
    ans += (l*p)
    ans %= mod
print(ans)
### BUGGY CODE ###

s = int(input())
k = int(input())
 
ans=0
 
n  = 5000000000000000
 
S = str(s) #文字列にする
L = len(S)
saisho = 0
 
for i in range(L):
  N = int(S[i])
  Nn = N**n
  if saisho <= k <= saisho + Nn:#最初からの文字数
    ans = N
    break
    
  else:
    saisho += Nn
    
print(ans)

### FIXED CODE ###

s = int(input())
k = int(input())
S = str(s) #文字列にする

ans=0

for i in range(k):
  N = int(S[i])
  
  if N == 1:
    ans = 1
  else:
    ans = N
    break  
print(ans)
### BUGGY CODE ###

#import time 

H, W = map(int, input().split())

status = [10000]*H*W
targets = set()
for i in range(H):
    s = input()
    for j in range(W):
        if s[j] == "#":
            targets.add((i, j))
            status[i*W+j] = 0

#t2 = time.time()
#c = 0
while True:
    #print("---")
    #for s_i in range(H):
    #    print(status[s_i*W:(s_i+1)*W])
    #print(targets)
    try:
        i, j = targets.pop()
    except KeyError:
        break
    
    d = status[i*W+j] + 1
    
    left = i*W+j-1
    if j != 0 and status[left] > d:
        status[left] = d # left
        targets.add((i, j-1))

    right = i*W+j+1
    if j != W-1 and status[right] > d:
        status[right] = d # right
        targets.add((i, j+1))

    up = (i-1)*W+j
    if i != 0 and status[up] > d:
        status[up] = d # up
        targets.add((i-1, j))

    down = (i+1)*W+j
    if i != H-1 and status[down] > d:
        status[down] = d # down
        targets.add((i+1, j))
    
    # c += 1
#t3 = time.time()

#print("count", c)
print(max(status))
#print(t3 - t2)

### FIXED CODE ###

import numpy as np

H, W = map(int, input().split())

status = np.full((H, W), H*W, dtype=int)
for i in range(H):
    s = input()
    for j in range(W):
        if s[j] == "#":
            status[i,j] = 0

for h in range(1, H):
    status[h, :] = np.minimum(status[h, :], status[h-1, :] + 1)
for h in range(0, H-1)[::-1]:
    status[h, :] = np.minimum(status[h, :], status[h+1, :] + 1)
for w in range(1, W):
    status[:, w] = np.minimum(status[:, w], status[:, w-1] + 1)
for w in range(0, W-1)[::-1]:
    status[:, w] = np.minimum(status[:, w], status[:, w+1] + 1)

print(np.max(status))
### BUGGY CODE ###

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

mod = 10**9+7

table = [0 for i in range(60)]
for i in a:
    for t in range(60):
        if i&1:
            table[t] += 1
        i >>= 1

ans = 0
for i in a:
    for j, s in enumerate(table):
        if i&1:
            ans += (n-s)*2**j
            ans %= 2*mod
        else:
            ans += s*2**j
            ans %= 2*mod
        i >>= 1
print(ans//2)

# -- | 01 | 10 | 11
# 01 | 00 | 11 | 10
# 10 | 11 | 00 | 01
# 11 | 10 | 01 | 00
# 12

# --- | 001 | 100 | 111
# 001 | 000 | 101 | 110
# 100 | 101 | 000 | 011
# 111 | 110 | 011 | 000
# 28

### FIXED CODE ###

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

mod = 10**9+7

ans = 0
p = 1
for i in range(60):
    s = sum(1 for b in a if b&p)
    ans += s*(n-s)*p
    ans %= mod
    p <<= 1
print(ans)
### BUGGY CODE ###

num_n = input()
N = map(int, raw_input().split())
num_m = input()
M = map(int, raw_input().split())
   
def solve(i, m):
   if m == 0:
      return True
   if i >= num_n or m > sum(M):
      return False
   res = solve(i + 1, m) or solve(i + 1,m - N[i])
   return res
    
for m in M:
   if solve(0, m):
      print "yes"
   else:
      print "no"

### FIXED CODE ###

_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')
### BUGGY CODE ###

N,W = map(int,input().split())
wv =[[0,0]]
dp = []
Counting = []
for _ in range(N):
    wv.append(list(map(int,input().split())))
for _ in range(N+1):
    dp.append([0]*(W+1))
    Counting.append([0]*(W+1))
for i in range(1,N+1):
    for sum_w in range(W+1):
        if Counting[i-1][sum_w] > sum_w:
            continue
        elif sum_w-wv[i][0]<0:
            dp[i][sum_w] =  dp[i-1][sum_w]
            Counting[i][sum_w]  = Counting[i-1][sum_w]
        else:
            if dp[i-1][sum_w] < dp[i-1][sum_w-wv[i][0]]+wv[i][1]:
                Counting[i][sum_w]  = Counting[i-1][sum_w-wv[i][0]]  + wv[i][0]
            else:
                Counting[i][sum_w]  = Counting[i-1][sum_w]
            dp[i][sum_w] = max(dp[i-1][sum_w],dp[i-1][sum_w-wv[i][0]]+wv[i][1])
print(dp[-1][-1])


### FIXED CODE ###

N,W = map(int,input().split())
wv =[[0,0]]
dp = []
Counting = []
for _ in range(N):
    wv.append(list(map(int,input().split())))
for _ in range(N+1):
    dp.append([0]*(W+1))
    Counting.append([0]*(W+1))
for i in range(1,N+1):
    for sum_w in range(W+1):
        if Counting[i-1][sum_w] > sum_w:
            continue
        elif sum_w-wv[i][0]<0:
            dp[i][sum_w] =  dp[i-1][sum_w]
            Counting[i][sum_w]  = Counting[i-1][sum_w]
        else:
            if dp[i-1][sum_w] < dp[i-1][sum_w-wv[i][0]]+wv[i][1]:
                Counting[i][sum_w]  = Counting[i-1][sum_w-wv[i][0]]  + wv[i][0]
            else:
                Counting[i][sum_w]  = Counting[i-1][sum_w]
            dp[i][sum_w] = max(dp[i-1][sum_w],dp[i-1][sum_w-wv[i][0]]+wv[i][1])
print(dp[-1][-1])