Harryxun/stf_run huggingface dataset:
def z_arr(s):

    Z = [0] * len(s)
    Z[0] = len(s)

    rt = 0
    lt = 0

    for k in range(1, len(s)):
        if k > rt:
            n = 0
            while n + k < len(s) and s[n] == s[n + k] and n < k:
                n += 1
            Z[k] = n
            if n > 0:
                lt = k
                rt = k + n - 1
        else:

            p = k - lt
            right_part_len = rt - k + 1

            if Z[p] < right_part_len:
                Z[k] = Z[p]
            else:
                i = rt + 1
                while i < len(s) and s[i] == s[i - k] and i < k:
                    i += 1
                Z[k] = i - k

                lt = k
                rt = i - 1
    return Z

N = int(input())
S = input()
answer = 0
for i in range(N-1):
    ZZ = z_arr(S[i:])
    # print(ZZ)
    temp_max = max(ZZ[1:])
    if answer < temp_max:
        answer = temp_max
print(answer)


### FIXED CODE ###

S = input()
if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')
S=input()
    T=input()
    cnt=0
    for i in range(3):
      if S[i]==T[i]:
        cnt+=1
    print(cnt)

### FIXED CODE ###

S=input()
T=input()
cnt=0
for i in range(3):
  if S[i]==T[i]:
    cnt+=1
print(cnt)
n = int(input())
v_list = list(map(int, input().split()))
c_list = list(map(int, input().split()))
sum = 0

for v, c in zip(v_list, c_list):
    if v - c > 0:
        sum += v - c

print(sum)


### FIXED CODE ###

a, b, t = map(int, input().split())
print(t // a * b)
N = int(input()) 
A = list(map(int, input().split())) 

M = 1000
X = 0

for i in range(N-1):
    if A[i] < A[i+1]:
        X = int(M/A[i])
        M = int(M - X * A[i])
    
	M = M + X * A[i+1]
    X = 0

print(int(M))


### FIXED CODE ###

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

M = 1000
X = 0

for i in range(N-1):
    if A[i] < A[i+1]:
        X = int(M/A[i])
        M = int(M - X * A[i])
    
    M = M + X * A[i+1]
    X = 0

print(int(M))
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = 0
for i in range(N):
    li = [A[2*i],A[2*i+1],A[3*N+i-2]]
    ans += li[1]
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = 0
for i in range(N):
    ans += A[2*i+1]
print(ans)
N,Q = map(int,input().split())
S = input()
lr_list = [list(map(int, input().split())) for i in range(Q)]

target = "AC"
ac_list =[]

index = -1
while True:
    index = S.find(target,index+ 1)
    if index == -1 :
        break
    ac_list.append(index)
    
for lr in lr_list:
    st = 0
    last = 0
    for i,ac in enumerate(ac_list):
#         print(ac+1,lr[0])
        if ac + 1 >= lr[0]:
            st = i
            break
    for i,ac in enumerate(ac_list[::-1]):
#         print(ac+1,lr[1]-1)
        if ac + 1 <= lr[1] - 1:
            end = len(ac_list) - i
            break
    
#     print(ac_list)
#     print(st,end)
    print(len(ac_list[st:end]))

### FIXED CODE ###

N,Q = map(int,input().split())
S = input()
lr_list = [list(map(int, input().split())) for i in range(Q)]

ac_list  = [0]*N
cnt = 0
for i in range(N-1):
    if i < len(S) and S[i:i+2] == "AC":
        cnt += 1
    ac_list[i+1] = cnt
        
for lr in lr_list:
    print(ac_list[lr[1]-1] - ac_list[lr[0]-1])
import math

s = map(int, raw_input().split())
print "%d" % (math.pow(s[0], s[1]) % 1000000007)

### FIXED CODE ###

NUM = 1000000007

def power(m, n):
    if n == 0:
        return 1
    if n == 1:
        return m
    if n % 2 == 0:
        tmp = power(m, n/2) % NUM
        return tmp ** 2 % NUM
    if n % 2 == 1:
        tmp = power(m, n/2) % NUM
        return m * (tmp**2) % NUM

s = map(int, raw_input().split())
print "%d" % (power(s[0], s[1]) % NUM)
from collections import defaultdict
from math import gcd

def main():
    n = int(input())
    mod = 1000000007
    zeroes = 0
    quad1 = defaultdict(int)
    quad2 = defaultdict(int)
    for _ in range(n):
        if a == b == 0:
            zeroes += 1
            continue

        a, b = map(int, input().split())
        g = gcd(a, b)
        a //= g; b//= g
        
        if b < 0:
            a, b = -a ,-b
        
        if a <= 0:
            a, b = b, -a
            quad1[(a,b)] += 0
            quad2[(a,b)] += 1
        else:
            quad1[(a,b)] += 1
            quad2[(a,b)] += 0

    ans = 1
    for k, v in quad1.items():
        now = 1
        now += pow(2, v, mod) -1
        now += pow(2, quad2[k], mod) -1
        ans = ans * now % mod
    
    ans += (zeroes - 1)
    print (ans % mod)


if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import defaultdict
import math


def main():
    n = int(input())
    mod = 1000000007
    zeroes = 0
    counter1 = defaultdict(int)
    counter2 = defaultdict(int)
    for _ in range(n):
        x, y = [int(x) for x in input().split()]

        if x == y == 0:
            zeroes += 1
            continue

        denominator = math.gcd(x, y)
        x, y = x // denominator, y // denominator

        if y < 0:
            # quadrant III, IV -> I, II
            x, y = -x, -y

        if x <= 0:
            # round 90° from quadrant II to I
            x, y = y, -x
            counter2[(x, y)] += 1
            counter1[(x, y)] += 0
        else:
            counter1[(x, y)] += 1
            counter2[(x, y)] += 0

    ans = 1
    for k, v in counter1.items():
        now = 1
        now += pow(2, v, mod) - 1
        now += pow(2, counter2[k], mod) - 1
        ans = ans * now % mod
    ans += zeroes
    ans -= 1  # choose no fish
    return ans % mod


if __name__ == '__main__':
    print(main())
# coding: utf-8
# Your code here!
x,n = map(int, input().split())
if n > 0:
    p = list(map(int , input().split()))
else:
    p  = []
a = list(set(list(range(1,101))) - set(p))
values = []
for i in a:
    values = values +  [[abs(x-i), i]]
values.sort(key=lambda x: x[0])
mins = values[0][0]
b = []
for i in values:
    if i[0] > mins:
        break
    b += [i[1]]
b.sort()
print(b[0])


### FIXED CODE ###

# coding: utf-8
# Your code here!
x,n = map(int, input().split())
if n > 0:
    p = list(map(int , input().split()))
else:
    p  = []
a = list(set(list(range(-100,102))) - set(p))
values = []
for i in a:
    values = values +  [[abs(x-i), i]]
values.sort(key=lambda x: x[0])
mins = values[0][0]
b = []
for i in values:
    if i[0] > mins:
        break
    b += [i[1]]
b.sort()
print(b[0])
def main():
    n = int(raw_input())
    print(n ** 3)
    pass

if __name__ == '__main__':
    main()

### FIXED CODE ###

n = int(input())
print(n ** 3)
n, x = map(int, input().split())

Ln = list( map(int, input().split()) )


curpos = 0
times = 1
while curpos <= x and times <= n+1:
    curpos += Ln[times-1]
    if curpos>x:
        break
    
    times += 1


print(times)

### FIXED CODE ###


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

Ln = list( map(int, input().split()) )


curpos = 0
times = 1
while curpos <= x and times < n+1:
    curpos += Ln[times-1]
    if curpos>x:
        break
    
    times += 1


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

A = sum(a)
a.sort(reverse=True)
print(a)

if a[m-1] >= A/(4*m):
    print("No")
else:
    print("Yes")

### FIXED CODE ###

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

a1 = b
b1 = a
a2 = c
c1 = a1

print(a2, b1, c1)
n = int(input())
a = list(map(int, input().split()))
di = {}
for i in a:
    if i in di:
        di[i] += 1
    else:
        di[i] = 1
k = list(di.keys())
v = list(di.values())
if n%3!=0 and len(di)>1:
    print('No')
elif len(di)==3 and v[0]==v[1]==v[2] and k[0]^k[1]^k[2]==0:
    print('Yes')
elif len(di)==2 and (v[0]<v[1] and v[0]==n//3 and k[0]==0) or (v[0]>v[1] and v[1]==n//3 and k[1]==0):
    print('Yes')
elif len(di)==1 and k[0]==0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
di = {}
for i in a:
    if i in di:
        di[i] += 1
    else:
        di[i] = 1
k = list(di.keys())
v = list(di.values())
if n%3!=0 and len(di)>1:
    print('No')
elif len(di)==3 and v[0]==v[1]==v[2] and k[0]^k[1]^k[2]==0:
    print('Yes')
elif len(di)==2 and ((v[0]<v[1] and v[0]==n//3 and k[0]==0) or (v[0]>v[1] and v[1]==n//3 and k[1]==0)):
    print('Yes')
elif len(di)==1 and k[0]==0:
    print('Yes')
else:
    print('No')
import math

sqrt = int(math.sqrt(r))
p = [1]*r
p[0] = 0
for i in range(1,sqrt):
    if p[i]:
        for j in range(2*i+1,r,i+1):
            p[j] = 0

s = [0 for i in range(11000)]
s[0] = 2
k = 1
for i in range(2,r):
    if p[i]:
        s[k] = i+1+s[k-1]
        k += 1
        
while True:
    n = int(raw_input())
    if not n:
        break
    print s[n-1]

### FIXED CODE ###

import math

r = 105000
sqrt = int(math.sqrt(r))
p = [1]*r
p[0] = 0
for i in range(1,sqrt):
    if p[i]:
        p[2*i+1::i+1] = [0 for x in range(2*i+1,r,i+1)]

s = [0 for i in range(11000)]
s[0] = 2
k = 1
for i in range(2,r):
    if p[i]:
        s[k] = i+1+s[k-1]
        k += 1
        
while True:
    n = int(raw_input())
    if not n:
        break
    print s[n-1]
import numpy as np

n,m = [int(i) for i in input().split()]
l = [[int(i) for i in input().split()] for _ in range(n)]
ans = np.zeros(10**5+1,dtype = np.int64)
start = 0
end = 0
for i,j in l:
    end += j
    ans[start:end] = i
    start = end
    
print(ans[m-1])

### FIXED CODE ###

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

temp = 0
l = sorted([[int(i) for i in input().split()] for _ in range(a)],key = lambda x: x[0])
for i in l:
    temp += i[1]
    if temp >= b:
        ans = i[0]
        break
print(ans)
P = int(input())
Q = int(input())
R = int(input())

if P < Q < R:
    t1 = P
    t2 = Q
elif P < R < Q:
    t1 = P
    t2 = R
else:
    t1 = Q
    t2 = R

print(t1+t2)

### FIXED CODE ###

P, Q, R = map(int, input().split())

times = []
times.append(P+Q)
times.append(P+R)
times.append(Q+R)

print(min(times))
N = int(input()) 
ans = 111111111110
for i in range(int(N**0.5+2)):
    if N%i == 0:
        use = N//i 
        s = str(use) 
        t = str(i) 
        ans = min(ans, max(len(s), len(t))) 

print(ans)

### FIXED CODE ###

N = int(input()) 
ans = 111111111110
for i in range(1,int(N**0.5+2)):
    if N%i == 0:
        use = N//i 
        s = str(use) 
        t = str(i) 
        ans = min(ans, max(len(s), len(t))) 

print(ans)
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)


def main():
    N, K = map(int, input().split())
    A_i = list(map(int, input().split()))
    B_i = [0 for i in range(N)]
    cycle_list = []
    
    cycle = 0
    diff = 0
    counter = 0
    machi = 1
    while counter < N:
        if B_i[machi - 1] == 1:
            diff = cycle_list.index(machi)
            cycle = counter - diff
            cycle_list = cycle_list[diff:]
            break
        else:
            counter += 1
            B_i[machi - 1] = 1
            cycle_list.append(machi)
            machi = A_i[machi - 1]

    if K < N:
        print(cycle_list[K - 1])
    else:
        mod_K = (K - diff) % cycle
        print(cycle_list[mod_K])

if __name__ == "__main__":
    main()


### FIXED CODE ###

import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)


def main():
    N, K = map(int, input().split())
    A_i = list(map(int, input().split()))
    B_i = [0 for i in range(N)]
    cycle_list = []
    diff_list = []
    cycle = 0
    diff = 0
    counter = 0
    machi = 1

    while counter < N:
        if B_i[machi - 1] == 1:
            diff = cycle_list.index(machi)
            cycle = counter - diff
            diff_list = cycle_list[:diff]
            cycle_list = cycle_list[diff:]
            break
        else:
            counter += 1
            B_i[machi - 1] = 1
            cycle_list.append(machi)
            machi = A_i[machi - 1]

    if K < diff:
        print(diff_list[K])
    else:
        mod_K = (K - diff) % cycle
        print(cycle_list[mod_K])

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

a.sort()

bc = []

for _ in range(m):
  bc.append(list(map(int, input().split())))

print(bc)

### FIXED CODE ###

rest = []

n = int(input())
for i in range(n):
  tmp = input().split()
  tmp[1] = int(tmp[1]) * (-1)
  tmp.append(i + 1)
  rest.append(tmp)

rest.sort()

for r in rest:
  print(r[2])
n,k=map(int,input().split())
h=list(map(int,input().split()))
ans=0
for i in h;
  if i>=k:
    ans+=1
print(ans)


### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
cnt=0
for i in h:
    if i>=k:
        cnt+=1
print(cnt)
import math

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

AL=[0]*N#左からi番目までのGCD
AR=[0]*N#右からi番目までのGCD
for i in range(N):
    if i == 0:
        AL[0] = A[0]
    else:
        AL[i] = math.gcd(AL[i-1],A[i])
for i in range(N):
    if i == 0:
        AR[0] = A[N-1]
    else:
        AR[i] = math.gcd(AR[i-1],A[N-i-1])

max=0
for i in range(N):
    if i == 0:
        n_ex_gcd =  AR[N-2]
    elif i == N-1:
        n_ex_gcd = AL[N-2]
    else:
        n_ex_gcd = math.gcd(AL[i-1],AR[N-i-2])
    if n_ex_gcd > max:
        max = n_ex_gcd
print(max)

### FIXED CODE ###

def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)

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

AL=[0]*N
AR=[0]*N
for i in range(N):
    if i == 0:
        AL[0] = A[0]
        AR[0] = A[N-1]
    else:
        AL[i] = gcd(AL[i-1],A[i])
        AR[i] = gcd(AR[i-1],A[N-i-1])

max=0
for i in range(N):
    if i == 0:
        n_ex_gcd =  AR[N-2]
    elif i == N-1:
        n_ex_gcd = AL[N-2]
    else:
        n_ex_gcd = gcd(AL[i-1],AR[N-i-2])
    if n_ex_gcd > max:
        max = n_ex_gcd
print(max)
import math
a,b = input().split()
print(int((int(a)*int(b))/math.gcd(a,b)))

### FIXED CODE ###

def gcd(a,b):
    return a if (b==0) else gcd(b,a%b)
a,b = map(int,input().split())
print(int((a*b)/gcd(a,b)))
# coding: utf-8
# Your code here!
x,n=map(int,input().split())
if n!=0:
    a=list(map(int,input().split()))
else:
    a=[0]*3
number=[0]*101

for num in range(len(a)):
    number[a[num]]=a[num]
    
counter=0
plus=0
ans=0

while counter==0:
    if number[x-plus]==0:
        counter+=1
        ans=x-plus
    elif number[x+plus]==0:
        counter+=1
        ans=x+plus
    else:
        plus+=1
        if plus>x or plus>(100-x):
            counter+=1
            ans=0

print(ans)

### FIXED CODE ###

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

for num in range(len(a)):
    if a[num]==0:
        print(num+1)
q = input()
x=100000
for i in range(len(q) - 2):
	y = abs(int(q[i:i+3]) - 753)
	if x > y :
		x = y
		
print(y)

### FIXED CODE ###

q = input()

if q == '7' or  q == '5' or q == '3':
	print('YES')
else:
	print('NO')
a,b,c=map(input().split(","))
print(a,b,c)

### FIXED CODE ###

a,b,c=input().split(",")
print(a,b,c)
N=int(input())
A=[int(i) for i in input().split()]

A.sort(reverse=True)

x=0
y=0
for i in range(len(A)):
      x=A[0]
      if A[0]==A[1]:
          A.remove(x)
          A.remove(x)
          if A[0]==A[1]:
                y=A[0]
                break
          else:
                A.remove(x)
      else:
          A.remove(x)
print(x*y)


### FIXED CODE ###

N=int(input())
A=[int(i) for i in input().split()]

A.sort(reverse=True)

x=0
y=0
for i in range(N-1):
      if A[0]==A[1]:
          x=A[0]
          A.remove(x)
          A.remove(x)
          break
      else:
          A.remove(A[0])
if len(A)>=2:
    for i in range(len(A)-1):
        if A[0]==A[1]:
            y=A[0]
            break
        else:
            A.remove(A[0])

print(x*y)
s = input()
for i, c in enumerate(s):
    if i % 2 == 0 and c == 'R':
        yes = False
    elif i % 2 == 1 and c == 'L':
        yes = False
if yes:
    print('Yes')
else:
    print('No')
    


### FIXED CODE ###

s = input()
yes = True
for i, c in enumerate(s):
    if i % 2 == 1 and c == 'R':
        #print(i)
        yes = False
    elif i % 2 == 0 and c == 'L':
        yes = False
        #print(i)
if yes:
    print('Yes')
else:
    print('No')
input()
A=list(map(int,input().split()))

cnt = 0
while True:
  flag = 0
  for i in range(N):
    if A[i] % 2 == 1:
      flag = 1
      break
    else:
      M[i] = M[i] / 2
  if flag == 1:
    print(cnt)
  else:
    cnt += 1

### FIXED CODE ###

s = input()

s1 = int(s[0])
s2 = int(s[1])
s3 = int(s[2])

print(str(s1+s2+s3))
list = [0] * 4
a = int(input())
list[0] = a/3600
a_p = a%3600
list[1] = a_p/60
list[2] = a_p%60
print ":".join(list)

### FIXED CODE ###

int = int(input())

h = int // 3600
h_mod = int % 3600

m = h_mod // 60
s = h_mod % 60

print(h, ":", m, ":", s, sep='')
import bisect

n,k= map(int,input().split())
x = [int(i) for i in input().split()]

idx = bisect.bisect_left(x,0)
"""
if x[idx] == 0:
    x.insert(idx,0)
"""

ans = 10**100

if x[idx] == 0 and idx - k + 1 >= 0:
    ans = min(ans,-x[idx-k+1])

print(ans)
exit()

for i in range(k+1):
    #print(idx-i,idx+k-1-i)
    if i == 0 and idx+k-1 < n:
        ans = min(ans, x[idx+k-1])
    elif idx - i < 0 or idx+k-1-i >= n:
        continue
    else:
        ans = min(ans, - 2*x[idx-i] + x[idx+k-1-i])
        ans = min(ans, - x[idx-i] + 2*x[idx+k-1-i])

print(ans)

### FIXED CODE ###

import bisect

n,k= map(int,input().split())
x = [int(i) for i in input().split()]

idx = bisect.bisect_left(x,0)
"""
if x[idx] == 0:
    x.insert(idx,0)
"""
ans = 10**100


for i in range(k+1):
    #print(idx-i,idx+k-1-i)
    if i == 0 and idx+k-1 < n:
        ans = min(ans, x[idx+k-1])
    elif idx - i < 0 or idx+k-1-i >= n:
        continue
    else:
        ans = min(ans, - 2*x[idx-i] + x[idx+k-1-i])
        ans = min(ans, - x[idx-i] + 2*x[idx+k-1-i])

if idx == n:
    ans = -x[-k]

print(ans)
from collections import deque

def operation(command, arrey):
    if command[0] == 'insert':
        arrey.insert(0,command[1])
        return arrey
    elif command[0] == 'delete':
        if command[1] in arrey:
            arrey.remove(command[1])
    elif command[0] == 'deleteFirst':
        arrey.popleft()
    elif command[0] == 'deleteLast':
        arrey.pop()


n = int(input())
list = deque()

for i in range(n):
    command = input().split()
    operation(command,list)

print(' '.join(list))

### FIXED CODE ###

from collections import deque
import sys
 
n = int(sys.stdin.readline())
q = deque()
 
for i in range(n):
    command = sys.stdin.readline()[:-1]
    if command[0] == 'i':
        q.appendleft(command[7:])
    elif command[6] == ' ':
        try:
            q.remove(command[7:])
        except Exception as e:
            pass
    elif command[6] == 'F':
        q.popleft()
    else:
        q.pop()
 
print(' '.join(q))
from math import gcd

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

# check
A.sort(reverse=True)
max_gcd = A[0]
change = False
for a in A:
    ans = gcd(ans, a)
    if ans < max_gcd and change is False:
        continue
    max_gcd = ans

print(max_gcd)

### FIXED CODE ###

from fractions import gcd


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

# 累積GCD
left = [0] * (n + 1)
right = [0] * (n + 1)
for i in range(n):
    left[i + 1] = (gcd(left[i], a[i]))
    right[n - i - 1] = (gcd(right[n - i], a[n - 1 - i]))

ans = 0
for i in range(n):
    ans = max(ans, gcd(left[i], right[i + 1]))
print(ans)
s=input()
ls=len(s)
now=[1]*ls
chlist=[]
while(1):
  tmp=[0]*ls
  for i in range(ls):
    if s[i]=="R":
      tmp[i+1]+=now[i]
    else:
      tmp[i-1]+=now[i]
  now=tmp
  if now in chlist:
    st=chlist.index(now)
    break
  else:
    chlist.append(now)
ch=chlist[st:]
idx=(10*100-st)%len(ch)-1
ans=[str(i) for i in ch[idx]]
print(" ".join(ans))

### FIXED CODE ###

s=input()
ls=len(s)
ans=[0]*ls
s+="R"
rst=lst=lend=0
for i in range(1,ls):
  if s[i]=="L" and lst==0:
    lst=i
  if lst==0:
    continue
  if s[i+1]=="R":
    lend=i
  if lend==0:
    continue
  ans[lst-1]=(lst-1-rst)//2+1+(lend-lst+1)//2
  ans[lst]=(lst-1-rst+1)//2+(lend-lst)//2+1
  rst=lend+1
  lst=lend=0

an=[str(i) for i in ans]
print(" ".join(an))
import math
x1, y1, x2, y2 = map(int, input().split())
print('%f' %(math.sqrt((x1-x2)**2 + (y1-y2)**2)))

### FIXED CODE ###

import math
x1, y1, x2, y2 = map(float, input().split())
print('%f' %(math.sqrt((x1-x2)**2 + (y1-y2)**2)))
#112
from itertools import product

N=int(input())
px=[]
py=[]
ph=[]

for _ in range(N):
    x,y,h=map(int,input().split())
    if h!=0:
        px.append(x)
        py.append(y)
        ph.append(h)


        
def Calc_H(Cxi,Cyj,pxi,pyj,hi):
    return hi+abs(Cxi-pxi)+abs(Cyj-pyj)

    
    
for Cxi,Cyj in product(range(101),range(101)):
    preH=Calc_H(Cxi,Cyj,px[0],py[0],ph[0])
    for i in range(1,N):
        nowH=Calc_H(Cxi,Cyj,px[i],py[i],ph[i])
        if preH!=nowH:
            break
        preH=nowH
    else:
        print(Cxi,Cyj,nowH)



### FIXED CODE ###

#112
from itertools import product

N=int(input())
px,py,ph=[],[],[]

for _ in range(N):
    x,y,h=map(int,input().split())
    if h!=0:
        px.append(x)
        py.append(y)
        ph.append(h)
        
def Calc_H(Cxi,Cyj,pxi,pyj,hi):
    return hi+abs(Cxi-pxi)+abs(Cyj-pyj)

for Cxi,Cyj in product(range(101),range(101)):

    if len(ph)!=1:
        preH=Calc_H(Cxi,Cyj,px[0],py[0],ph[0])
        for i in range(len(ph)):
            nowH=Calc_H(Cxi,Cyj,px[i],py[i],ph[i])
            if nowH!=preH:
                break
            preH=nowH
        else:
            print(Cxi,Cyj,nowH)
            break
    else:
        print(px[0],py[0],ph[0])
        break
n,k,s=map(int,input().split())
if k==n:
    x=[s]*n
    print(" ".join(map(str,x)))
else if k==0:
    x=[s+1]*n
    print(" ".join(map(str,x)))
else:
    x=[s]*k
    y=[s+1]*(n-k)
    z=" ".join(map(str,x))+" "+" ".join(map(str,y))
    print(z)


### FIXED CODE ###

n,k,s=map(int,input().split())
if k==n:
    x=[s]*n
    print(" ".join(map(str,x)))
elif k==0:
    if s<10**9:
        x=[s+1]*n
    else:
        x=[1]*n
    print(" ".join(map(str,x)))
else:
    if s<10**9:
        x=[s]*k
        y=[s+1]*(n-k)
    else:
        x=[s]*k
        y=[1]*(n-k)
    z=" ".join(map(str,x))+" "+" ".join(map(str,y))
    print(z)
array1 = [int(input()) for i in range(6)]
# array1 = [15,18,26,35,36,18]
array2 = input[:5]
k = array1[5] 
 
for i in range(5):
  if (i < 4 and array2[4 - i] - array2[0] > k):
    print(':(')
    break
  if (i < 3 and array2[4 - i] - array2[1] > k):
    print(':(')
    break
  if (i < 2 and array2[4 - i] - array2[2] > k):
    print(':(')
    break
  if (i < 1 and array2[4 - i] - array2[3] > k):
    print(':(')
    break
  if (i == 4):
    print('Yay!')

### FIXED CODE ###

array1 = [int(input()) for i in range(6)]
array2 = array1[:5]
k = array1[5] 
 
for i in range(5):
  if (i < 4 and array2[4 - i] - array2[0] > k):
    print(':(')
    break
  if (i < 3 and array2[4 - i] - array2[1] > k):
    print(':(')
    break
  if (i < 2 and array2[4 - i] - array2[2] > k):
    print(':(')
    break
  if (i < 1 and array2[4 - i] - array2[3] > k):
    print(':(')
    break
  if (i == 4):
    print('Yay!')
N=input()
K=input()
X=input()
Y=input()
if N<=K:
  print(N*X)
else:
  print(K*X + (N-K)*Y)
  

### FIXED CODE ###

N=int(input())
K=int(input())
X=int(input())
Y=int(input())

if N > K:
  print(K*X+(N-K)*Y)
else:
  print(N*X)
i = 0

 while True:
  i += 1
  x = raw_input()
  if x == '0':
   break
  print 'case %d: %s' % (i,x)

### FIXED CODE ###

 

import sys
for i,ws in enumerate(sys.stdin, 1):
    w = ws[:-1]
    if w =='0': break
    print 'Case %d: %s' % (i, w)
n,k = map(int,input().split())
d = [0]*k
A = [[0]*k]*n
l = set(range(1,n+1))
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l - set(A[i])
print(len(l))

### FIXED CODE ###

n,k = map(int,input().split())
d = [0]*k
A = [[0]*n]*k
l = set()
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l.union(A[i])
if set(range(1,n+1)) == l:
	print(0)
else:
	print(len(set(range(1,n+1))-l))