Harryxun/stf_run huggingface dataset:
n,m = map(int,input().split())
def Fib(n):
  seq = []
  a,b = 0,1
  for i in range(1,n+1):
    if i == 1:
      seq.append(0)
    elif i == 2:
      seq.append(1)
    else:
      a, b = b, a + b
      seq.append(b)
  return seq
table = Fib(n)
temp = -1
route = 1
mod = 10**9+7
for _ in range(m):
  a = int(input())
  dif = a-temp-1
  temp = a
  route = route*table[dif]%mod
print(route*table[n-temp]%mod)  

### FIXED CODE ###

n,m = map(int,input().split())
def Fib(n):
  seq = []
  a,b = 0,1
  for i in range(1,n+10):
    if i == 1:
      seq.append(0)
    elif i == 2:
      seq.append(1)
    else:
      a, b = b, a + b
      seq.append(b)
  return seq
table = Fib(n)
temp = -1
route = 1
mod = 10**9+7
for _ in range(m):
  a = int(input())
  dif = a-temp-1
  temp = a
  route = route*table[dif]%mod
print(route*table[n-temp]%mod)
W,a,b = map(int,input())
if a <= b <= a+W or a<= b+W <= a+W:
    print(0)
elif a+W < b:
    print(b-(a+W))
elif b+W <a:
    print(a-(b+W))

### FIXED CODE ###

#ABC056.B
W,a,b = map(int,input().split())
if a<= b <= a+W or a <= b+W <= a+W:
    print(0)
elif a + W <b:
    print(b-(a+W))
elif b+W <a:
    print(a-(b+W))
m=map(int,input().split())
a=[int(x) for x  in input().split()]
if sum(a)-n<0:
  print(-1)
else:
  print(sum(a)-n)

### FIXED CODE ###

n,m=map(int,input().split())
a=[int(x) for x in input().split()]
if n-sum(a)<0:
  print(-1)
else:
  print(n-sum(a))
s = input()[::-1]
length = len(s)
a = [0] * length
d = [0] * length
ans = [0] * 2019
x = 10

a[0] = int(s[0])
d[0] = a[0]
ans[d[0]] += 1

for i in range(1, length):
    a[i] = int(s[i]) * x % 2019
    d[i] = (d[i-1] + a[i]) % 2019
    ans[d[i]] += 1
    x = x * 10 % 2019

print(int(sum([ans[i] * (ans[i]-1) for i in range(2019)]) / 2) + ans[0])

### FIXED CODE ###

s, w = map(int, input().split())
print("unsafe" if s <= w else "safe")
n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [tuple(map(int, input().split())) for _ in range(m)]
a.sort()
bc.sort(reverse=True, key=lambda x: x[1])
last_idx = len(a) - 1
idx = 0
for e in bc:
    b, c = e
    for i in range(b):
        if i + idx > last_idx:
            break
        if a[i + idx] < c:
            a[i + idx] = c
        else:
            break
    else:
        idx += b
        print(a)
        print(idx)
        continue
    break

print(sum(a))


### FIXED CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [tuple(map(int, input().split())) for _ in range(m)]
a.sort()
bc.sort(reverse=True, key=lambda x: x[1])
last_idx = len(a) - 1
idx = 0
for e in bc:
    b, c = e
    for i in range(b):
        if i + idx > last_idx:
            break
        if a[i + idx] < c:
            a[i + idx] = c
    idx += b

print(sum(a))
# -*- coding: utf-8 -*-
import numpy as np
from operator import itemgetter
def solve():
    Z = sorted([tuple(map(int,input().split())) for _ in range(int(input()))], key=itemgetter(2) , reverse=True)
    x0, y0, h0 = Z[0]
    H = h0 + np.abs(np.arange(101, dtype=int).reshape(1,101)-x0) + np.abs(np.arange(101, dtype=int).reshape(101,1)-y0)
    return [' '.join(map(str, [i,j,h])) for (i,j),h in np.ndenumerate(H) if all(h == max(H[i,j]-abs(x-i)-abs(y-j),0) for x,y,h in Z)][0]

if __name__ == '__main__':
    print(solve())

### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy as np
from operator import itemgetter
def solve():
    Z = sorted([tuple(map(int,input().split())) for _ in range(int(input()))], key=itemgetter(2,0,1) , reverse=True)
    x0, y0, h0 = Z[0]
    H = h0 + np.abs(np.arange(101, dtype=int).reshape(101,1)-x0) + np.abs(np.arange(101, dtype=int).reshape(1,101)-y0)
    for (i,j), h in np.ndenumerate(H):
        if all(h == max(H[i,j]-abs(x-i)-abs(y-j), 0) for x,y,h in Z):
            return ' '.join(map(str, [i,j,h]))

if __name__ == '__main__':
    print(solve())
a,b = input()
print('Even' if (a * b) % 2 == 1 else  'Odd')

### FIXED CODE ###

a,b = map(int,input().split())
print('Even' if (a * b) % 2 == 0 else  'Odd')
INF = 10 ** 20

v_num, e_num, r = map(int, input().split())
dist_lst = [INF for _ in range(v_num)]
edges_lst = [[] for _ in range(e_num)]
negative_cycle_flag = False

for _ in range(e_num):
  s, t, dist = map(int, input().split())
  edges_lst[s].append((dist, t))

dist_lst[r] = 0

for _ in range(v_num):
  for v in range(v_num):
    if dist_lst[v] != INF:
      for dist, to in edges_lst[v]:
        if dist_lst[v] + dist < dist_lst[to]:
          dist_lst[to] = dist_lst[v] + dist

for v in range(v_num):
  if dist_lst[v] != INF:
    for dist, to in edges_lst[v]:
      if dist_lst[v] + dist < dist_lst[to]:
        negative_cycle_flag = True
        break
    if negative_cycle_flag:
      break

if negative_cycle_flag:
  print("NEGATIVE CYCLE")
else:
  for dist in dist_lst:
    if dist == INF:
      print("INF")
    else:
      print(dist)


### FIXED CODE ###

"""
BellmanFord
"""

INF = 10 ** 20

v_num, e_num, r = map(int, input().split())
dist_lst = [INF for _ in range(v_num)]
edges_lst = [[] for _ in range(e_num)]
negative_cycle_flag = False

for _ in range(e_num):
  s, t, dist = map(int, input().split())
  edges_lst[s].append((dist, t))

dist_lst[r] = 0

if e_num != 0:
  for _ in range(v_num):
    for v in range(v_num):
      if dist_lst[v] != INF:
        for dist, to in edges_lst[v]:
          if dist_lst[v] + dist < dist_lst[to]:
            dist_lst[to] = dist_lst[v] + dist
  
  for v in range(v_num):
    if dist_lst[v] != INF:
      for dist, to in edges_lst[v]:
        if dist_lst[v] + dist < dist_lst[to]:
          negative_cycle_flag = True
          break
      if negative_cycle_flag:
        break

if negative_cycle_flag:
  print("NEGATIVE CYCLE")
else:
  for dist in dist_lst:
    if dist == INF:
      print("INF")
    else:
      print(dist)
n,a,b = map(int, input().split())
s = 0

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


for i in range(n):
    s += cmb(n,i,mod)

s -= cmb(n,a,mod)
s -= cmb(n,b,mod)
print(s)

### FIXED CODE ###

def comb(n, r, p):
    numer = 1
    denom = 1
 
    for i in range(n-r+1, n+1):
        numer = numer * i % p
    for i in range(1, r+1):
        denom = denom * i % p
    return numer * pow(denom, p-2, p) % p
 
p = pow(10, 9) + 7
n, a, b = map(int, input().split())
print(((pow(2, n, p) - comb(n, a, p) - comb(n, b, p) - 1)) % p)
N=int(input())
lis=[]
for i in range(101):
    for j in range(101):
        lis.append([i,j])
l2=[]
for i in range(N):
    l2.append(list(map(int, input().split())))
l2.sort(key=lambda x:x[2],reverse=True)
for i in lis:
    n=N
    l=0
    for j in l2:
        k=abs(i[0]-j[0])+abs(i[1]-j[1])+j[2]
        if j[2]==0:
            if k>l:
                n-=1
                continue
            else:
                if l==k or l==0:
                    l=k
                    n-=1
                else: break
        else:
            if l==k or l==0:
                l=k
                n-=1
            else: break
        if n==0:
            m=(i[0],i[1],l)
print('{} {} {}'.format(m[0],m[1],m[2]))

### FIXED CODE ###

N=int(input())
lis=[]
for i in range(101):
    for j in range(101):
        lis.append([i,j])
l2=[]
for i in range(N):
    l2.append(list(map(int, input().split())))
l2.sort(key=lambda x:x[2],reverse=True)
for i in lis:
    n=N
    l=0
    for j in l2:
        k=abs(i[0]-j[0])+abs(i[1]-j[1])+j[2]
        if j[2]==0:
            if k>l:
                n-=1
            else:
                if l==k or l==0:
                    l=k
                    n-=1
                else: break
        else:
            if l==k or l==0:
                l=k
                n-=1
            else: break
        if n==0:
            m=(i[0],i[1],l)
print('{} {} {}'.format(m[0],m[1],m[2]))
while 1:
    m,n=map(int,input().split())
    if m==0:break
    a,i,c=[i+1 for i in range(m)],0,0
    while i<n:
        i+=1
        b,f=input(),0
        if len(a)==1:continue
        if i%15==0:
            if b!='FizzBuzz':
                del a[c]
                f=1
        elif i%5==0:
            if b!='Buzz':
                del a[c]
                f=1
        elif i%3==0:
            if b!='Fizz':
                del a[c]
                f=1
        else:
            if b!=str(i):
                del a[c]
                f=1
        if f:m-=1
        else:c=(c+1)%m
    print(*a)

### FIXED CODE ###

while 1:
    m,n=map(int,input().split())
    if m==0:break
    a,i,c=list(range(1,m+1)),0,0
    while i<n:
        i+=1
        b,f=input(),0
        if m<2:continue
        if i%15==0:
            if b!='FizzBuzz':
                del a[c]
                f=1
        elif i%5==0:
            if b!='Buzz':
                del a[c]
                f=1
        elif i%3==0:
            if b!='Fizz':
                del a[c]
                f=1
        elif b!=str(i):
            del a[c]
            f=1
        if f:m-=1
        else:c+=1
        c%=m
    print(*a)
A=str(input () )
B=0
while B ==!2:
if A[B] == A[B+1]:
    print ('Bad')
    B += 1 
    break  
    print('Good')

### FIXED CODE ###

A=str(input () )
B=0
while B!=3:
    if A[B]==A[B+1]:
        print('Bad')
        break
    else:    
        B=B+1
else:
    print('Good')
print(input()**2)

### FIXED CODE ###

print(int(input())**2)
# -*- coding: utf-8 -*-
from scipy.sparse.csgraph import floyd_warshall

"""
def warshall_floyd(d):
    for k in range(N):
        for i in range(N):
            for j in range(N):
                d[i][j] =min(d[i][j],d[i][k] + d[k][j])            
    return d
"""
N, M, L = map(int, input().split())

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

for i in range(M):
    A, B, C = map(int, input().split())
    d[A-1][B-1] = C
    d[B-1][A-1] = C
    d[i][i] = 0

d = floyd_warshall(d, directed = False)
S = [[0 for i in range(N)] for i in range(N)]


for i in range(N):
    for j in range(N):
        if d[i][j] <= L:
            S[i][j] = 1
            S[j][i] = 1
            
S = floyd_warshall(S, directed = False)

Q = int(input())

for i in range(Q):
    s, t = map(int, input().split())
    if S[s-1][t-1] == 0:
        print(-1)
    else: 
        print(int(S[s-1][t-1]-1))

### FIXED CODE ###

# -*- coding: utf-8 -*-
from scipy.sparse.csgraph import floyd_warshall

"""
def warshall_floyd(d):
    for k in range(N):
        for i in range(N):
            for j in range(N):
                d[i][j] =min(d[i][j],d[i][k] + d[k][j])            
    return d
"""
N, M, L = map(int, input().split())

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

for i in range(M):
    A, B, C = map(int, input().split())
    d[A-1][B-1] = C
    d[B-1][A-1] = C

d = floyd_warshall(d, directed = False)
S = [[0 for i in range(N)] for i in range(N)]


for i in range(N):
    for j in range(N):
        if d[i][j] <= L:
            S[i][j] = 1
            S[j][i] = 1
            
S = floyd_warshall(S, directed = False)

Q = int(input())

for i in range(Q):
    s, t = map(int, input().split())
    if S[s-1][t-1] == float("inf"):
        print(-1)
    else: 
        print(int(S[s-1][t-1]-1))
str = raw_input()[0:-1]
print "Yes" if((str[0] == str[1] and str[1] == str[2] and str[2] == str[3]) or (str[1] == str[2] and str[2] == str[3] and str[3] == str[4])) else "NO"


### FIXED CODE ###

str = raw_input()
print "Yes" if((str[0] == str[1] and str[1] == str[2]) or (str[1] == str[2] and str[2] == str[3]))else "No"
s = input()
n = len(s)

front = s[:(n-1)//2]
rear = s[(n+1)//2:]

if s == s[::-1] and front == front[::-1] ans rear == rear[::-1]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

S = str(input())
N = len(S)
 
head = round((N-1)/2)
end = round((N+3)/2-1)

headS = S[:head]
endS = S[end:]

if S==S[::-1] and headS == headS[::-1] and endS == endS[::-1]:
	print('Yes')
else:
  	print('No')
Cost0 = 0
CostN = 0

listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
X = listA[0][2]

for x in listA:
   length += len(x)

for i in range(length - 3):
    if (listA[1][i] < X):
        Cost0 = Cost0 +1
    else:
        CostN = CostN +1

if (Cost0 < CostN):
    print(Cost0)
else:
    print(CostN)


### FIXED CODE ###

Cost0 = 0
CostN = 0
length = 0

listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
X = listA[0][2]

for x in listA:
   length += len(x)

for i in range(length - 3):
    if (listA[1][i] < X):
        Cost0 = Cost0 +1
    else:
        CostN = CostN +1

if (Cost0 < CostN):
    print(Cost0)
else:
    print(CostN)
mod=10**9+7
n, k=map(int, input().split())
a=list(map(int, input().split()))
jibun=0
for i in range(n):
    for j in range(i+1, n):
        if a[i]>a[j]:
            jibun=jibun+1

saki=0
for i in range(n):
    for j in range(n):
        if a[i]>a[j]:
            saki=saki+1
ans=0

print((jibun*k)%mod+int((1/2)*saki*k*(k-1))%mod)%mod)


### FIXED CODE ###

mod=10**9+7
n, k=map(int, input().split())
a=list(map(int, input().split()))
jibun=0
for i in range(n-1):
    for j in range(i+1, n):
        if a[i]>a[j]:
            jibun=(jibun+1)%mod

saki=0
for i in range(n):
    for j in range(n):
        if a[i]>a[j]:
            saki=(saki+1)%mod

ans=jibun*k+saki*k*(k-1)//2
print(ans%mod)
N = int(input())
abc = [[int(j) for j in input().split()] for i in range(n)]
dp = [[0] * 3]
for day in range(N):
    dp += [[max([dp[-1][p] + abc[day][n] for p in range(3) if p != n]) for n in range(3)]]
print(max(dp[-1]))

### FIXED CODE ###

N = int(input())
abc = [[int(j) for j in input().split()] for i in range(N)]
dp = [[0] * 3]
for day in range(N):
    dp += [[max([dp[-1][p] + abc[day][n] for p in range(3) if p != n]) for n in range(3)]]
print(max(dp[-1]))
N = int(input())
for h in range(3500):
  for n in range(3500):
    w = (N*h*n) / (4*n*h - N*n - N*h)
    if w>0 and w.is_integer():
      print(h, n, int(w))

### FIXED CODE ###

N = int(input())
for h in range(3500):
  for n in range(h):
    try:w = (N*h*n) / (4*n*h - N*n - N*h)
    except ZeroDivisionError: continue
    if w>0 and w.is_integer():
      print(h, n, int(w))
      exit()
R =int(input())
G =int(input())
print(2G-R)

### FIXED CODE ###

R =int(input())
G =int(input())
print(2*G-R)
import math

r = int(input())

area          = math.pi * r ** 2
circumference = 2 * math.pi * r

print("%.6f %.6f" % (area, circumference))

### FIXED CODE ###

import math

r = float(input())

area = math.pi * r ** 2
circumference = 2 * math.pi * r

print("%.6f %.6f" % (area, circumference))
import math
A,B,H,M=map(int, input().split())
a=math.pi
b=math.cos(a*((48H+M)/360))
Z=A**2+B**2-2ABb
print(Z**(1/2))

### FIXED CODE ###

import math
A,B,H,M=map(int, input().split())
a=math.pi
b=math.cos(a*((60*H-11*M)/360))
Z=A**2+B**2-2*A*B*b
print(Z**(1/2))
a, b = map(int, input().split())
ans = 1 if 1 not in (a, b) else 2 not in (a, b) else 3
print(ans)

### FIXED CODE ###

a, b = int(input()), int(input())
ans = 1 if 1 not in (a, b) else 2 if 2 not in (a, b) else 3
print(ans)
s = input()
K = int(input())
base_count = ord("z") + 1
ans = ""
for c in s:
    if (base_count - ord(c)) <= K:
        ans += "a"
        K -= (base_count - ord(c))
    else:
        ans += c
if K > 0:
    ans = ans[:-1] + chr(ord(ans[-1]) + K)
print(ans)

### FIXED CODE ###

s = input()
K = int(input())
base_count = ord("z") + 1
ans = ""
for c in s:
    t = (base_count - ord(c)) % 26
    if t <= K:
        ans += "a"
        K -= t
    else:
        ans += c
if K > 0:
    K = K % 26
    ans = ans[:-1] + chr((ord(ans[-1]) + K))
print(ans)
a,b,c,d=list(map(int,input().split()))
x=a+b
y=c+d
if x>y:
  print("Left")
 elif x<y:
  print("Right")
 else:
  print("Balanced")


### FIXED CODE ###

a,b,c,d=list(map(int,input().split()))
x=a+b
y=c+d
if x>y:
  print("Left")
elif x<y:
  print("Right")
else:
  print("Balanced")
def comb(n, r):
  if n <= 0 or r < 0:
    raise ValueError
  if r > n - r:
    r = n - r
  if r == 0:
    return 1
  return (n - r + 1) * comb(n, r - 1) // r

N, K = list(map(int, input().split()))
for i in range(N - K + 1):
  print(comb(N - K + 1, i + 1) * comb(K - 1, i) % 1000000007)

### FIXED CODE ###

def comb(n, r):
  if n < 0 or r < 0:
    raise ValueError
  r = min(r, n - r)
  if n == 0 or r == 0:
    return 1
  return (n - r + 1) * comb(n, r - 1) // r

N, K = list(map(int, input().split()))
for i in range(K):
  if N - K + 1 < i + 1:
    print('0')
    continue
  print(comb(N - K + 1, i + 1) * comb(K - 1, i) % (10 ** 9 + 7))
N = int(input())
count = 0
for i in range(N):
  a,b = map(int,input().sprit())
  if a == b:
    count+=1
    if count = 3:
      print("Yes")
      break
  else:
    count = 0
print("No")

### FIXED CODE ###

N = int(input())
count = 0
for i in range(N):
  a,b = map(int,input().split())
  if a == b:
    count+=1
    if count == 3:
      print("Yes")
      break
  else:
    count = 0
else:
  print("No")
import numpy as np


def main(X, N, a):
    a.append(10000000000)
    a.append(-10000000000)
    a.sort()
    maxn = a[0]-1
    for i in range(len(a)-1):

        if a[i] >= X:
            if a[i+1]-a[i] > 1:
                if X-maxn>a[i]+1-X
                maxn = a[i]+1
                break
            if X-maxn < a[i]-X:
                break
        else:
            if a[i+1]-a[i] > 1:
                if a[i+1] > X and a[i] < X:
                    maxn = X
                    break
                maxn = a[i+1]-1

    return maxn


X, N = map(int, input().split())
try:
    a = list(map(int, input().split()))
except:
    a = []
print(main(X, N, a))


### FIXED CODE ###

import numpy as np


def main(X, N, a):
    a.append(10000000000)
    a.append(-10000000000)
    a.sort()
    maxn = a[0]-1
    for i in range(len(a)-1):

        if a[i] >= X:
            if a[i+1]-a[i] > 1:
                if X-maxn>a[i]+1-X:
                    maxn = a[i]+1
                break
            if X-maxn < a[i]-X:
                break
        else:
            if a[i+1]-a[i] > 1:
                if a[i+1] > X and a[i] < X:
                    maxn = X
                    break
                maxn = a[i+1]-1

    return maxn


X, N = map(int, input().split())
try:
    a = list(map(int, input().split()))
except:
    a = []
print(main(X, N, a))
from sys import stdin
import datetime

i = stdin.readline().strip()
d = datetime.date.fromisoformat("-".join(i.split("/")))
print("Heisei" if d < datetime.date.fromisoformat("2019-04-30") else "TBD")


### FIXED CODE ###

from sys import stdin
 
i = stdin.readline().strip()
d = tuple(map(int, i.split("/")))
print("Heisei" if d <= (2019,4,30) else "TBD")
n=int(input())
data=list(map(int, input().split()))
count = 0
while(True):
  data = list(filter(lambda x: x%2==0, data))
  if len(data) < n:
    print(count)
    break
  else:
    count+=1

### FIXED CODE ###

ret = list(filter(lambda x: x==1, map(int, list(input()))))
print(len(ret))
N = int(input())
a_list = [int(a) for a in input().split()]

if a[0] > 1:
    print(-1)
    exit()

ans = a_list[-1] + 1
temp1 = [""]*(N+1)
temp1[-1] = a_list[-1]
for n in range(N-1, 0, -1):
    temp1[n] = temp1[n+1]+a_list[n]
    
temp2 = 1
print(temp1)
for n in range(1, N):
    temp2 = (temp2-a_list[n-1])*2
    ans_temp = min(temp2, temp1[n])
    
    if ans_temp < a_list[n]:
        print(-1)
        exit()
    
    ans += ans_temp
    
print(ans)

### FIXED CODE ###

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

sita_maxi = [0 for i in range(n+1)]
sita_maxi[n] = a[n]
for i in range(n-1, -1, -1):
    sita_maxi[i] = sita_maxi[i+1] + a[i]

if a[0] > 1:
    print(-1)
    exit()

lst = [1]
for i in range(1, n+1):
    lst.append(min((lst[i-1]-a[i-1])*2, sita_maxi[i]))
    if lst[-1] < a[i]:
        print(-1)
        exit()

print(sum(lst))
a = input()
if 9 in a:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a = input()
if str(9) in a:
  print("Yes")
else:
  print("No")
n, k = map(int,input().split())
a_l = list(map(int,input().split()))

town = 1
count = 0
town_visited = set()
while count < k:
    town_visited.add(town)
    town = a_l[town-1]
    count += 1
    if town in town_visited:
        break

k -= count
if k = 0:
    print(town)
    exit()
count = 0
town_visited = set()
while count < k:
    town_visited.add(town)
    town = a_l[town-1]
    count += 1
    if town in town_visited:
        break

remain = k%count
count = 0
while count < remain:
    town = a_l[town-1]
    count += 1
   
print(town)

### FIXED CODE ###

n, k = map(int,input().split())
a_l = list(map(int,input().split()))

town = 1
count = 0
town_visited = set()
while count < k:
    town_visited.add(town)
    town = a_l[town-1]
    count += 1
    if town in town_visited:
        break

k -= count
if k == 0:
    print(town)
    exit()
count = 0
town_visited = set()
while count < k:
    town_visited.add(town)
    town = a_l[town-1]
    count += 1
    if town in town_visited:
        break

remain = k%count
count = 0
while count < remain:
    town = a_l[town-1]
    count += 1
   
print(town)
import numpy as np

D, G, *pc = map(int, open(0).read().split())
pc = list(zip(*[iter(pc)]*2))
p, c = np.array([]), np.array([])
for (x,y) in pc:
    p = np.append(p, x)
    c = np.append(c, y)
    
import numpy as np
import math

base_points = np.array([i*100 for i in range(1, D+1)])

ans = []

for i in range(2**D):
    bit_flag = np.array(list(map(int, format(i, '0%db' %D))))
    
    points = sum(bit_flag * (c + p*base_points))
    solved_num = sum(bit_flag * p)
    
    if points >= G:
        ans.append(solved_num)

    else:
        achieved = False
        remained = G - points
        remained_problems = sorted((bit_flag==False) * np.array(range(1, D+1)), reverse=True)
        i = 0

        while not achieved:
            highest_p = remained_problems[i]
            if remained <= 0:
                achieved = True
            elif math.ceil(remained / (highest_p * 100)) <= p[highest_p - 1]:
                solved_num += math.ceil(remained / (highest_p * 100))
                remained -= (math.ceil(remained / (highest_p * 100)) * highest_p * 100)
            else:
                solved_num += p[highest_p - 1]
                remained -= (highest_p * 100 * p[highest_p - 1] + c[highest_p - 1])
                i += 1

        ans.append(solved_num)
        
print(int(min(ans)))

### FIXED CODE ###

import numpy as np

D, G, *pc = map(int, open(0).read().split())
pc = list(zip(*[iter(pc)]*2))
p, c = np.array([]), np.array([])
for (x,y) in pc:
    p = np.append(p, x)
    c = np.append(c, y)
    
import numpy as np
import math

base_points = np.array([i*100 for i in range(1, D+1)])

ans = []

for i in range(2**D):
    bit_flag = np.array(list(map(int, format(i, '0%db' %D))))
    points = sum(bit_flag * (c + p*base_points))
    solved_num = sum(bit_flag * p)
    
    if points >= G:
        ans.append(solved_num)

    else:
        remained = G - points
        remained_problems = sorted((bit_flag==False) * np.array(range(1, D+1)), reverse=True)
        i = 0

        while True:
            if remained <= 0:
                break
                
            highest_p = remained_problems[i]

            if math.ceil(remained / (highest_p * 100)) <= p[highest_p - 1]:
                solved_num += math.ceil(remained / (highest_p * 100))
                remained -= (math.ceil(remained / (highest_p * 100)) * highest_p * 100)
            else:
                solved_num += p[highest_p - 1]
                remained -= (highest_p * 100 * p[highest_p - 1] + c[highest_p - 1])
                i += 1

        ans.append(solved_num)
        
print(int(min(ans)))
data = [int(i) for i in input().split()]

data.sort()
 print("{0}{1}{2}".format(data[0],data[1],data[2]))

### FIXED CODE ###

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

data.sort()
print("{0} {1} {2}".format(data[0],data[1],data[2]))