Harryxun/stf_run huggingface dataset:
X,Y=map(int,input().split())

def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod

Z=((X+Y)//3)

if (X+Y)%3==0 and abs(X-Y)<=Z:
  ans=(comb(Z, X-Z,(10**9+7)
  print(ans)
else:
  print(0)

### FIXED CODE ###

X,Y=map(int,input().split())

def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod

Z=((X+Y)//3)

if (X+Y)%3==0 and abs(X-Y)<=Z:
  ans=(comb(Z, X-Z,(10**9+7)))
  print(ans)
else:
  print(0)
# coding: utf-8
import os
import time
import re
import math


def main():
    global N,M,A,mod,memo
    N,M=map(int,input().split())
    A=[int(input()) for  a in range(M)] #a (1段~N-1段)
    start=time.time();#
    memo=[-1]*(N+1)
    
    mod=10**9+7+1
    print(dp(0))
    #print("{}ms".format(math.floor(time.time()*1000-start*1000)))#

def dp(index):
    global N,M,A,mod,memo
    if(index>N):return 0
    if(index==N):memo[index]=1
    if(A.count(index)>0):memo[index]=0
    if memo[index]==-1:
        memo[index]=(dp(index+1)+dp(index+2))%mod
    return memo[index]

main()


### FIXED CODE ###

# coding: utf-8
import os
import time
import re
import math


def main():
    N,M=map(int,input().split())
    A=[int(input()) for  a in range(M)] #a (1段~N-1段)
    start=time.time();#
    memo=[0]*(N+1)
    memo[0]=1
    ban=[False]*(N+1)
    for a in A:
        ban[a]=True
    mod=1000000007
    for a in range(1,N+1):
        if ban[a]:
            memo[a]=0
        else:
            if a>1:
                memo[a]=(memo[a-1]+memo[a-2])%mod
            else:
                memo[a]=1



    print(memo[-1]%mod)
    #print("{}ms".format(math.floor(time.time()*1000-start*1000)))#


main()
a,b,c= map(int, input().split())
print(max(0,c-(a-b))

### FIXED CODE ###

a,b,c= map(int, input().split())
print(max(0,c-(a-b)))
K = int(input())

t = 7
for i in range(K):
    if t % K == 0:
        print(i + 1)
        break
    t = (t * 10 + 7) % K
    else:
        print(-1)

### FIXED CODE ###

K = int(input())

if K % 2 == 0 or K % 5 == 0:
    print(-1)
    exit()

i = 0
ai = 0
while True:
    ai = (ai * 10 + 7) % K
    i += 1
    if ai == 0:
        break
print(i)
N = int(input())
S = input()
count = 0
for i in range(N):
  if S[i]=="A" and S[i+1]=="B" and S[i+2]=="C":
    count = count + 1

print(count)

### FIXED CODE ###

N = input()
S = input()

print(S.count("ABC"))
import numba as nb 
from collections import defaultdict
n,W=list(map(int,input().split()))
li=[]
wr=[0]*n
vr=[0]*n
dd=defaultdict(lambda:0)
for i in range(n):
	w,v=map(int,input().split())
	wr[i]=w
	vr[i]=v
mw=min(wr)


@nb.njit()
def maxv(i,w):
	if dd[(i,w)]!=0:
		
		return dd[(i,w)]
	if i==n:
		return 0
	if W-w<mw:
		return 0
	if w+wr[i]<=W:
		a=vr[i]+maxv(i+1,w+wr[i])
	else:
		a=0
	b=maxv(i+1,w)
	c=max(a,b)
	dd[(i,w)]=c
	return c
print(maxv(0,0))



### FIXED CODE ###

n,W=map(int,input().split())
dp=[0]*(W+1)
dd=dp.copy()
for i in range(n):
	w,v=map(int,input().split())
	for j in range(W):
		cw=j+w
		cv=dp[j]+v
		if cw <=W and dd[cw]<cv:
			dd[cw]=cv
	dp=dd.copy()
print(dp[W])
a = int(input())
for i in range(9):
  if(a%(i+1) ==0 and a/(i+1)<=9):
    print("Yes") 
    exit()
print("No")  

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b) if(a<=9 and b<=9) else print(-1)
X = int(input())
XX=np.arange(X,X+10**4)

s=0
for j in XX:
    if (s==1):
        break
    for i in range(2, j+1):
        N= j % i
#        print('j=' ,j ,' i=' ,i, N)
        if (N ==  0 and i==j ):
            print(j)
            s=1
        if (N ==  0):
          #  print('true')
            break
#        else:
#            print(j)

### FIXED CODE ###

import numpy as np
#import copy
#import fractions
#
###############入  力###################
#a, b, c, d = map(int, input().split())  # a=2 b=4 c=5 d =7
#a = list(map(int, input().split()))     # a = [2, 4, 5, 6]
#s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき
##行数指定
##3
##hoge
##foo
##bar
#n=int(input())
#string_list=[input() for i in range(n)] #['hoge','foo','bar']
#
###############初期化、コピー##############
#a=[0]*5 #[0, 0, 0, 0, 0]
#b=copy.deepcopy(a)  #2次元配列はこうコピーする
#b2=a[:]  #1次元のときはコピーはこれで良い
#
###############小数点表示################
#a = 0.364364
#print(a) #0.364364
#print("{:.6f}".format(a)) #0.364364
#print("{:.4f}".format(a)) #0.3644 小数点第4位に丸めることもできる。
#
###############ゼロ埋め・幅寄せ################
#print("python".ljust(15,'-')) # 左詰め　　　 #python---------
#print("python".center(15,'-'))# 中央寄せ　　#-----python----
#print("python".rjust(15,'-')) # 右詰め　　　 #---------python
#print(str(29).rjust(10,'0')) #10桁ゼロ埋め　 #0000000029
#
###############文字列操作################
#'abc123def'[:] #すべての文字列が取れる #'abc123def'
#'abc123def'[-1:] #終端文字がとれる    #'f'
#'abc123def'[:-1] #最後の1文字以外のものがとれる。 #'abc123de'
#'abc123def'[::-1] #文字が逆転する #'fed321cba'
#
###############二分探索################
#import bisect
#listA=[1,2,5,2,4,6,7,8,6,56,3,56,76,34,32,2,6,0,32,6,0] 
#listA.sort()
#zeroindex=bisect.bisect_right(listA,0) #ソートされたリスト内で0の場所を探し、右側Indexを返す
#clearlistA=listA[zeroindex:]#0以下が存在しないリストを得る
#
#
###############最小公倍数,最大公約数
#import fractions
#a,b=map(int, input().split())
#a,b= 24, 6
#f=fractions.gcd(a,b)
#f2=a*b//f
#print(f,f2)
#
###############四則演算
#a + b #足し算（加算）: +演算子
#a - b#引き算（減算）: -演算子
#a * b#掛け算（乗算）: *演算子
#a / b#割り算（除算）: /演算子
#a// b#割り算の整数部（整数除算）: //演算子
#a % b#割り算の剰余（余り, mod）: %演算子
#a** b#べき乗: **演算子

X = int(input())
XX=np.arange(X,X+10**4)

s=0
for j in XX:
    if (s==1):
        break
    for i in range(2, j+1):
        N= j % i
#        print('j=' ,j ,' i=' ,i, N)
        if (N ==  0 and i==j ):
            print(j)
            s=1
        if (N ==  0):
          #  print('true')
            break
#        else:
#            print(j)
n=int(input())
lists=list(map(int,input().split())
anslists=[0]*(n+1)

for i in range(n-1,-1,-1):
    cnt=0
    check=0
 # i= n-1, n-2......1,0
 #左からi+1番目に着いて調べる
    number=n//(i+1)
    if number==1:
          anslists[i]=lists[i]
    else:
        while cnt<=number-1:
           check+=anslists[i+cnt*(i+1)]
        nums=check-lists[i]
        if nums%2==0:
           anslists[i]=lists[i]
        elif nums%2!=0:
           if lists[i]==0:
               anslists[i]=1
           if lists[i]==1:
               anslists[i]=0
           
           
print(*anslists)
        
           
           
  

           
       
        
   
          
          

### FIXED CODE ###

n=int(input())
lists=list(map(int,input().split()))
lists.insert(0,0)
anslists=[0]*(n+1)
for j in range(n,0,-1):
# j=n,n-1,.......,2,1という感じ
    numbers=n//j
    if numbers==1:
        anslists[j]=lists[j]
    else:
        check=0
        for i in range(2,numbers+1):
            check+=anslists[i*j]
            
        if check%2==0:
            anslists[j]=lists[j]
            
        else:
            
            if lists[j]==1:
                anslists[j]=0
                
            if lists[j]==0:
                anslists[j]=1
                

printA=0

del anslists[0]


Anslist=[]
for k in range(n):
    if anslists[k]==1:
        printA+=1
        Anslist.append(k+1)
print(printA)
print(*Anslist)
N = input()

if S[0] == S[1] == S[2]:
    print("Yes")
elif S[1] == S[2] == S[3]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S = input()

if S[0] == S[1] == S[2]:
    print("Yes")
elif S[1] == S[2] == S[3]:
    print("Yes")
else:
    print("No")
from datetime.datetime import datetime
datetime.datetime(2019, 4, 30, 0, 0)
S=datetime.strptime(S,'%Y/%m/%d')
x=datetime.datetime(2019, 4, 30, 0, 0)
if x>S:
     print('TBD')
else:
     print("Heisei")

### FIXED CODE ###

Y,M,D=map(int,input().split("/"))
if (Y,M,D)>(2019,4,30):
  print("TBD")
else:
   print("Heisei")
n=int(input())
A=list(map(int,input().split( )))
B=list(map(int,input().split( )))
count=0
flag=True
while flag:
    flag=False
    for i in range(-1,n-1):
        tonari=B[i-1]+B[i+1]
        tmp=(B[i]-A[i])//tonari
        if tmp>0:
            B[i]-=tonari*tmp
            count+=tmp
            flag=True
if A==B:
    print(count)
else:
    print(-1)

### FIXED CODE ###

import sys
S=input()
K=1

if len(S)==1:
    print(K)
    sys.exit
elif len(S)==2:
    if S[0]==S[1]:
        print(1)
        sys.exit
    else:
        print(2)
        sys.exit
else:
    pass
l=len(S)

S1=[]
S2=[]

S1.append(1)
if S[0]!=S[1]:
    S1.append(2)
else:
    S1.append(1)
S2.append(0)
S2.append(1)
for i in range(2,l):
    if S[i]!=S[i-1]:
        S1.append(max(S1[i-1]+1,S2[i-1]+1))
    else:
        S1.append(S2[i-1]+1)
    try:
        if S2[i]==S2[i-2] and S2[i-1]==S2[i-3]:
            S2.append(S1[i-2]+1)
    except:
        S2.append(max(S1[i-2]+1,S2[i-2]+1))

print(max(S2[l-1],S1[l-1]))
import numpy as np
n = int(input())
x = []
y = []
h = []
for i in range(n):
    tx, ty, th = map(int, input().split())
    if th != 0:
        x.append(tx)
        y.append(ty)
        h.append(th)
x = np.array(x)
y = np.array(y)
h = np.array(h)
else:
    for cx in range(0,101):
        for cy in range(0,101):
            tmp = h + np.abs(x - cx) + np.abs(y - cy)
            if np.max(tmp) == np.min(tmp):
                print(cx, cy, np.max(tmp))

### FIXED CODE ###

import numpy as np
n = int(input())
origin = []
modified = []
for i in range(n):
    tx, ty, th = map(int, input().split())
    origin.append([tx, ty, th])
    if th != 0:
        modified.append([tx, ty, th])
origin = np.array(origin).T
modified = np.array(modified).T
for cx in range(0,101):
    for cy in range(0,101):
        tmp = modified[2] + np.abs(modified[0] - cx) + np.abs(modified[1] - cy)
        if np.max(tmp) == np.min(tmp):
            height = np.max(tmp)
            # print("cx = ", cx, "cy = ", cy, "height =", height)
            # print(origin[0])
            # print(origin[1])
            # print(origin[2])
            # print(np.maximum(height - np.abs(origin[0] - cx) - np.abs(origin[1] - cy), np.zeros(origin[0].size)))
            if (origin[2] == np.maximum(height - np.abs(origin[0] - cx) - np.abs(origin[1] - cy), np.zeros(origin[0].size))).all():
                print(cx, cy, height)
a,b=map(int,input().split())
print(max([a+b,a-b,a×b]
          ))


### FIXED CODE ###

a,b=map(int,input().split())
print(max([a+b,a-b,a*b]
          ))
print(input()[0] + input()[0] + input()[0])

### FIXED CODE ###

a = list(input().split())
print(a[0][0] + a[1][0] + a[2][0])
n=int(input())
x=input()
count_x=x.count("1")
px10=0
nx10=0
xi=[0]*n
ans=[0]*(n+1)
for i in range(1,n+1):
    popcount=format(i,"b").count("1")
    fx=i%popcount
    ans[i]=ans[fx]+1
for i in range(n):
    px10+=(int(x[i])*pow(2,n-1-i,count_x+1))%(count_x+1)
    if count_x!=0 and count_x!=1:
        nx10+=int(x[i])*pow(2,n-1-i,count_x-1)%(count_x-1)
for i in range(n):
    if x[i]=="0":
        xi10=(px10+pow(2,n-1-i,count_x+1))%(count_x+1)
        print(ans[xi10]+1)
    else:
        xi10=(nx10-pow(2,n-1-i,count_x-1))%(count_x-1)
        print(ans[xi10]+1)


### FIXED CODE ###

n=int(input())
x=input()
count_x=x.count("1")
px10=0
nx10=0
xi=[0]*n
ans=[0]*(n+1)
for i in range(1,n+1):
    popcount=format(i,"b").count("1")
    fx=i%popcount
    ans[i]=ans[fx]+1
for i in range(n):
    px10+=(int(x[i])*pow(2,n-1-i,count_x+1))%(count_x+1)
    if count_x!=0 and count_x!=1:
        nx10+=int(x[i])*pow(2,n-1-i,count_x-1)%(count_x-1)
for i in range(n):
    if x[i]=="0":
        xi10=(px10+pow(2,n-1-i,count_x+1))%(count_x+1)
        print(ans[xi10]+1)
    else:
        if count_x!=1:
            xi10=(nx10-pow(2,n-1-i,count_x-1))%(count_x-1)
            print(ans[xi10]+1)
        else:
            print(0)
N, M = map(int, input().split())
PY = [list(map(int,input().split())) for i in range(N)]

PY_sort = sorted(PY)

tmp = dict()

before = 0
for py in PY_sort:
    if before != py[0]:
        count = 0
    count += 1
    tmp[py] = count

for py in PY:
    print("{:06}{:06}".format(tmp[py][0],tmp[py][1]))

### FIXED CODE ###

N, M = map(int, input().split())
PY = [tuple(map(int,input().split())) for i in range(M)]

PY_sort = sorted(PY)

tmp = dict()

before = 0
for py in PY_sort:
    if before != py[0]:
        before = py[0]
        count = 0
    count += 1
    tmp[py] = count

for py in PY:
    print("{:06}{:06}".format(py[0],tmp[py]))
n, m, l = (int(i) for i in input().split())
A = []
B = []
#C = [[0] * n] * l
C = [[0 for i in range(n)] for j in range(l)]
product = [[0 for d in range(l)] for dd in range(n)]
#??\?????????????????????????´?
for i in range(n):
    #swap_list = input().split()
    #A.append(swap_list)
    A.append([int(i) for i in input().split()])
for i in range(m):
    #swap_list = input().split()
    #B.append(swap_list)
    B.append([int(i) for i in input().split()])
#????????????????¨????
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += int(A[i][k]) * int(B[k][j])
#?????????????????????
#for i in range(n):
#    for j in range(l):
#        print("{0}".format(C[i][j]), end="\b")
#    print("")
#for i in range(n):
#    print(" ".join(map(str, C[i][:])))
for r in C:
    print(' '.join([str(d) for d in r]))

### FIXED CODE ###

n, m, l = (int(i) for i in input().split())
A = []
B = []
C = [[0 for i in range(l)] for j in range(n)]
#??\?????????????????????????´?
for i in range(n):
    swap_list = input().split()
    A.append(swap_list)
    #A.append([int(i) for i in input().split()])
for i in range(m):
    swap_list = input().split()
    B.append(swap_list)
    #B.append([int(i) for i in input().split()])
#????????????????¨????
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += int(A[i][k]) * int(B[k][j])
#?????????????????????
#for i in range(n):
#    for j in range(l):
#        print("{0}".format(C[i][j]), end="\b")
#    print("")
for i in range(n):
    print(" ".join(map(str, C[i][:])))
#for r in C:
#    print(" ".join([str(d) for d in r]))
dish = [0]*5
dish = [list(input()) for i in range(len(dish))]
time = 0
sumtime = 0

dish_sort = sorted(dish, key=lambda x:x[-1])
dish_sort = [''.join(dish_sort[i]) for i in range(len(dish))]
dish_sort1 = [int(i) for i in dish_sort]
dish_sort2 = [i for i in dish_sort1 if not i%10==0]
dish_sort1.remove(dish_sort2[0])

for i in range(len(dish)-1):
    while dish_sort1[i] > time:
        time += 10
    sumtime += time
    time = 0
print(sumtime+dish_sort2[0])

### FIXED CODE ###

dish = [0]*5
dish = [list(input()) for i in range(len(dish))]
time = 0
sumtime = 0

dish_sort = sorted(dish, key=lambda x:x[-1],reverse=True)
dish_sort = [''.join(dish_sort[i]) for i in range(len(dish))]
dish_sort = [int(i) for i in dish_sort]
dish1 = [i for i in dish_sort if i%10==0]
dish2 = [i for i in dish_sort if not i%10==0]
dish3 = dish1 + dish2

if len(dish2)==0:
    dish2.append(dish3[-1])
for i in range(len(dish3)-1):
    while dish3[i] > time:
        time += 10
    sumtime += time
    time = 0
print(sumtime+dish2[-1])
# 隣との距離が大きいところで担当区間を区切るのがお得。
# 各担当区間では行ったり来たりせずに端から端まで動くのがお得。

n, m = map(int, input().strip().split())
xs = sorted(list(map(int, input().strip().split())))

intervals = sorted([(xs[i + 1] - xs[i], i) for i in range(m - 1)], reverse=True)

divides = sorted([ind for _, ind in intervals[:n - 1]])

if n >= m:
    print(0)
else:
    total = 0
    for i in range(len(divides) + 1):
        if i == 0:
            interval = xs[divides[i]] - xs[0]
        elif i < len(divides):
            interval = xs[divides[i]] - xs[divides[i - 1] + 1]
        else:
            interval = xs[-1] - xs[divides[i - 1] + 1]

        total += interval

print(total)


### FIXED CODE ###

# 隣との距離が大きいところで担当区間を区切るのがお得。
# 各担当区間では行ったり来たりせずに端から端まで動くのがお得。

n, m = map(int, input().strip().split())
xs = sorted(list(map(int, input().strip().split())))
if n >= m:
    print(0)
elif n == 1:
    print(xs[-1] - xs[0])
else:
    intervals = sorted([(xs[i + 1] - xs[i], i) for i in range(m - 1)], reverse=True)

    divides = sorted([ind for _, ind in intervals[:n - 1]])

    total = 0
    for i in range(len(divides) + 1):
        if i == 0:
            interval = xs[divides[i]] - xs[0]
        elif i < len(divides):
            interval = xs[divides[i]] - xs[divides[i - 1] + 1]
        else:
            interval = xs[-1] - xs[divides[i - 1] + 1]

        total += interval

    print(total)
import sys
from collections import defaultdict
from itertools import combinations

input = sys.stdin.readline


def main():
    N = int(input())
    x = [0] * N
    y = [0] * N
    for i in range(N):
        x[i], y[i] = map(int, input().split())

    vector = defaultdict(int)
    for a, b in combinations(range(N), 2):
        dx = x[a] - x[b]
        dy = y[a] - y[b]
        if dx == 0:
            vector[(0, abs(dy))] += 1
        elif dx > 0:
            vector[(dx, dy)] += 1
        else:
            vector[(-dx, -dy)] += 1

    ans = N - max(vector.values())
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from collections import defaultdict
from itertools import combinations

input = sys.stdin.readline


def main():
    N = int(input())
    x = [0] * N
    y = [0] * N
    for i in range(N):
        x[i], y[i] = map(int, input().split())

    if N == 1:
        print(1)
        sys.exit()

    vector = defaultdict(int)
    for a, b in combinations(range(N), 2):
        dx = x[a] - x[b]
        dy = y[a] - y[b]
        if dx == 0:
            vector[(0, abs(dy))] += 1
        elif dx > 0:
            vector[(dx, dy)] += 1
        else:
            vector[(-dx, -dy)] += 1

    ans = N - max(vector.values())
    print(ans)


if __name__ == "__main__":
    main()
n,a,b = map(int, input().split())

res = 0

for i in range(1,n+1):
    x5 = i//10000
    x4 = (i-x5*10000)//1000
    x3 = (i-x5*10000-x4*1000)//100
    x2 = (i-x5*10000-x4*1000-x3*100)//10
    x1 = i % 10
    
    xx = x5+x4+x3+x2+x1
    if b >= xx >= a:
        res += i

print(res)

### FIXED CODE ###

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

z = y//x 

temp = 1
for i in range(10000):
    temp *= 2
    if z < temp:
        print(i+1)
        exit()
A,B= map(int,input().split(" "))
count = 0
x = int(A/10**4)
y = int(A/10**3) - x*10
z = int(A/10**2) - x*10**2 - y*10
N = A 
while N <= B:
    while y < 10:
        while z < 10:
                    N = x*(10**4)+y*(10**3)+z*(10**2)+y(10**1)+x
                    if N >= B:
                        break
                    count = count + 1
                    z = z + 1
        y = y + 1
    x = x + 1
    y = 0
    z = 0
print(count)

### FIXED CODE ###

A,B= map(int,input().split(" "))
count = 0
x = int(A/10**4)
y = int(A/10**3) - x*10
z = int(A/10**2) - x*10**2 - y*10
N = A
while N <= B:
    while y < 10:
        while z < 10:
                    N = x*(10**4)+y*(10**3)+z*(10**2)+y*(10**1)+x
                    if N > B:
                        break
                    if N == B:
                        count = count + 1
                        break
                    if N < A:
                        count = count -1
                    count = count + 1
                    z = z + 1
        z = 0
        y = y + 1
        if N >= B:
            break
    x = x + 1
    y = 0
print(count)
N = int(input())

ans = -1

for i in range(1,N+1):
    if int(int(i)*1.08) == N:
        ans = i

if ans =! -1:
    print(ans)
else:
    print(":(")


### FIXED CODE ###

N = int(input())

ans = -1

for i in range(1,N+1):
    if int(i*1.08) == N:
        ans = i

if ans != -1:
    print(ans)
else:
    print(":(")
N,X=map(int, input(),split())
print("Yes" if 500*N >= X else "No")

### FIXED CODE ###

N,X=map(int, input().split())
print("Yes" if 500*N >= X else "No")
n = [1 << i for i range(9)]
print(max(int(i) for i in input().split() if int(i) in n))

### FIXED CODE ###

input()
n = eval(input().replace(' ', '|'))
for i in range(201):
    if n & 1 << i:
        print(i)
        break
a = []
for i in range(3):
    a.append(list(input().split()))


answer = ""
for i in range(3):
    answer += str(a[i][i])
print(answer)


### FIXED CODE ###

a = [input() for i in range(3)]

answer = ""
for i in range(3):
    answer += a[i][i]
print(answer)
N, K = map(int, input().split())
A = list(map(int, input().split()))

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

for i in range(N):
    a = A[i]
    for j in reversed(range(N)):
        for l in range(L+1):
            if l < a: continue
            dp[j+1][l] += dp[j][l-a]

ans = 0
for j in range(N):
    ans += dp[j+1][(j+1)*K]
print(ans)

### FIXED CODE ###

N, A = map(int, input().split())
X = list(map(int, input().split()))
L = max(X)
L = max(L, A)

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

for j in range(1, N+1):
    for k in range(N+1):
        for s in range((N+1)*(L+1)):
            if s < X[j-1]:
                dp[j][k][s] = dp[j-1][k][s]
            if k >= 1 and s >= X[j-1]:
                dp[j][k][s] = dp[j-1][k][s] + dp[j-1][k-1][s-X[j-1]]
ans = 0
for k in range(1, N+1):
    ans += dp[N][k][k*A]
print(ans)
N, M = map(int, input().split())
a = [0]*M
for i in range(M):
    s, c = map(int, input().split())
    a[s-1] = c
if a[0] == 0:
    print("-1")
else:
    print(*a, sep="") 

### FIXED CODE ###

N, M = map(int, input().split())
A=[]
for j in range(M):
    s, c = map(int, input().split())
    A.append([s-1, str(c)])
if N == 1:
    b = 0
elif N == 2:
    b= 10
else:
    b = 100
ans=[]
for i in range(b, 1000):
    a = 0
    for j in range(M):
        x=str(i)
        if len(x) < N:
            break 
        if A[j][1] == x[A[j][0]]:
            a += 1
    if a == M:
        ans.append(i)
if ans == []:
    print(-1)
else:
    print(min(ans))
n,k=map(int,input().split())
pl=list(map(int,input().split()))
cl=[0]*2*n
res=[]
next=0
for x in range 2*n:
  if cl[next]==0:
    cl[next]=1
    next=pl[next]-1
  if cl[next]==1:
    res.append(next+1)
    cl[next]=2
    next=pl[next]-1
  else:
    lroop=len(res)
    k-=count.cl(1)
    num=k%lroop
    print(res[num-1])
    break
else:
  print(next+1)

### FIXED CODE ###

n, k = map(int, input().split())
li = list(map(int, input().split()))
 
check = [0] * (n+10)
res = []
next = 0
 
for i in range(k):
    if check[next] == 0:
        check[next] = 1
        next = li[next]-1
    elif check[next] == 1:
        check[next] += 1
        res.append(next+1)
        next = li[next]-1
    else:
        cnt = len(res)
        k -= check.count(1)
        amari = k%cnt
        print(res[amari])
        break
else:
    print(next+1)
L = []
while True:
    (a, op, b) = map(str, raw_input().split())
    A, B = int(a), int(b)
    if A == 0 and op == '?' and B == 0:
        break
    else:
        if op == '+':
            L.append(A + B)
        elif op == '-':
            L.append(A - B)
        elif op == '*':
            L.append(A * B)
        else:
            L.append(A / B)

for x in range(len(L)):
    print L[x]

### FIXED CODE ###

L = []
while True:
    (a, op, b) = map(str, raw_input().split())
    A, B = int(a), int(b)
    if op == '?':
        break
    else:
        if op == '+':
            L.append(A + B)
        elif op == '-':
            L.append(A - B)
        elif op == '*':
            L.append(A * B)
        else:
            L.append(A / B)

for x in range(len(L)):
    print L[x]