Harryxun/stf_run huggingface dataset:
n,m=map(int,input().split())
a=[0]*(n)
if m>0:
  for _ in range(m):
    a[int(input())]+=1
dp=[0]*(n+1)
dp[0]=1
if a[1]!=1:
  dp[1]=1
if n==1:
  if a[1]==0:
    print(1)
    exit()
  else:
    print(0)
    exit()
for i in range(2,n+1):
  if a[i-2]==0 and a[i-1]==0:
    dp[i]=dp[i-2]+dp[i-1]
  elif a[i-1]!=0 and a[i-2]==0:
    dp[i]=dp[i-2]
  elif a[i-2]!=0 and a[i-1]==0:
    dp[i]=dp[i-1]
  else:
    dp[i]=0
print(dp[n]%(10**9+7))    

### FIXED CODE ###

n,m=map(int,input().split())
a=[0]*(n)
if n==1:
  print(1)
  exit()
if m>0:
  for _ in range(m):
    a[int(input())]+=1
dp=[0]*(n+1)
dp[0]=1
if a[1]!=1:
  dp[1]=1
for i in range(2,n+1):
  if a[i-2]==0 and a[i-1]==0:
    dp[i]=dp[i-2]+dp[i-1]
  elif a[i-1]!=0 and a[i-2]==0:
    dp[i]=dp[i-2]
  elif a[i-2]!=0 and a[i-1]==0:
    dp[i]=dp[i-1]
  else:
    dp[i]=0
print(dp[n]%(10**9+7))
if x = 0:
  print(1)
else:
  print(0)

### FIXED CODE ###

x = int(input())
if x == 0:
  print(1)
else:
  print(0)
num      = raw_input()
max      = 1 - 1000000000
length   = len(num)

for i in range (length):
    for j in range (i + 1, n):
        if (max > (num[i] - num[j])):
            max = num[i] - num[j]

print max

### FIXED CODE ###

n = input()
R = [0 for i in range(n)]
for i in range(n):
    R[i] = input()
maxv = -2000000000
minv = R[0]

for j in range(1, n):
    maxv = max(maxv, R[j] - minv)
    minv = min(minv, R[j])

print maxv
a,b = (int(x) for x in input().split())
s = input()
num = 0

for i in s:
    if int(s)>= 0 and int(s)<= 9:
        num += 1

if a + b == num and s[a] == '-':
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a,b = (int(x) for x in input().split())
s = input()
num = 0

for i in s:
    if i == '-':
        continue
    elif int(i)>= 0 and int(i)<= 9:
        num += 1
    
    

if a + b == num and s[a] == '-':
    print('Yes')
else:
    print('No')
from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
x = input()
c = x.count('1')

y = 0
for i in range(n):
    y += int(x[i])*2**(n-1-i)
a = [-1]*10000
a[0] = 0
a[1] = 1

for i in range(n):
    ans = 0
    if x[i] == '0':
        c_tmp = c + 1
        y_tmp = y + 2**(n-1-i)
    else:
        c_tmp = c - 1
        y_tmp = y - 2**(n-1-i)
    reg = y_tmp
    while y_tmp != 0:
        ans += 1
        y_tmp = y_tmp % c_tmp
        c_tmp = format(y_tmp,'b').count('1')
        try:
            if 0 < y_tmp < n and a[y_tmp] != -1:
                ans += a[y_tmp]
                break
        except:
            continue
    print(ans)
    try:
        a[reg] = ans
    except:
        continue

### FIXED CODE ###

from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def MAP1()  : return map(lambda x:int(x)-1,input().split())
def LIST()  : return list(MAP())
def LIST1() : return list(MAP1())

def solve():
    N = INT()
    xbin = input()
    xdec = int(xbin, 2)
    m = xbin.count('1')

    a = xdec % (m+1)
    b = xdec % (m-1) if m > 1 else 0

    num = [0]*N
    for i in range(1, N):
        num[i] = num[i % bin(i).count('1')] + 1

    for i in range(N):
        if xbin[i] == '0':
            y = ( a + pow(2, N-i-1, m+1) ) % ( m+1 )
            print(num[y] + 1)
        elif m <= 1:
            print(0)
        else:
            y = ( b - pow(2, N-i-1, m-1) ) % ( m-1 )
            print(num[y] + 1)

if __name__ == '__main__':
    solve()
a,b=map(int,input().split())
for s in range(b//10000+1):
    try:
        for t in range(b//5000+1):
            r=b-s-t
            if 10000*s+5000*t+1000*r==b and s+t+r==a:
                print(s,t,r)
                exit()
    except ZeroDivisionError:
        continue
print(-1,-1,-1)

### FIXED CODE ###

print(len(set(open(0).read().split()[1:])))
N = int(input())

ls = N%10

if ls == 2,4,5,7,9:
  print("hon")
  
elif ls == 0,1,6,8:
  print("pon")
  
else:
  print("bon")

### FIXED CODE ###

N = int(input())
 
mod = N % 10
 
if mod in [2,4,5,7,9]:
  print("hon")
  
elif mod in [0,1,6,8]:
  print("pon")
  
else:
  print("bon")
S=input()
K=[]
G[]
for i in range(0,len(S),2):
  K.append(S[i])
  try:
    G.append(S[i+1])
  except:
    pass
if ('L' in K) or ('R' in G):
  print('No')
else:
  print('Yes')

### FIXED CODE ###

S=input()
K=[]
G=[]
for i in range(0,len(S),2):
  K.append(S[i])
  try:
    G.append(S[i+1])
  except:
    pass
if ('L' in K) or ('R' in G):
  print('No')
else:
  print('Yes')
n,x = list(map(int,input().split()))
data = [int(s) for s in input().split()]
dis = [None] * (n-1)
#distanceの生成
for i in range(n-1):
    dis[i] = abs(data[i+1] - data[i])
if n == 1:
    print(abs(data[0]-x))
    exit()
dis.sort()
#distanceのGCD
ans = 0
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
for i in range(n-1):
    ans = gcd(dis[i+1],dis[i])
    
print(ans)

### FIXED CODE ###

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)
n,x = list(map(int,input().split()))
data = [int(s) for s in input().split()]
dis = [None] * (n-1)
#distanceの生成
for i in range(n-1):
    dis[i] = abs(data[i+1] - data[i])
if n == 1:
    print(abs(x-data[0]))
    exit()

dis.sort()
if n == 2:
    temp = min(abs(x-data[0]),abs(x-data[1]))
    print(gcd(temp,dis[0]))
    exit()
#distanceのGCD



for i in range(n-2):#n-2→n == 2 の時を考慮
    dis[i+1] = gcd(dis[i+1],dis[i])
    
print(dis[i+1])
N,A,B=map(int,input().split())

print(sum(i in i range(1,N+1) if A<=sum(map(int,str(i)))<=B))


### FIXED CODE ###

N,A,B=map(int,input().split())
print(sum(i for i in range(1,N+1) if A<=sum(map(int,str(i)))<=B))
n = input()
sum = 0
for i in range(n):
  if i % 3 != 0 and i % 5 != 0:
    sum += i
    
print(sum)

### FIXED CODE ###

n = int(input())
sum = 0
for i in range(1, n+1):
  if i % 3 != 0 and i % 5 != 0:
    sum += i
    
print(sum)
n = int(input())

if(n == 0):
    print(1)
else if(n == 1):
    print(0)

### FIXED CODE ###

n = int(input())

if(n == 0):
    print(1)
elif(n == 1):
    print(0)
a, b = map(int, input.split())
print(max(0, a-b))

### FIXED CODE ###

a, b = map(int, input().split())
print(max(0, a-b))
a=list(int,input().split());a.sort();s=a[0]*a[1]
if (a[2]*s)%2==0:print(0)
else:print(s)

### FIXED CODE ###

a=list(map(int,input().split()));a.sort();s=a[0]*a[1]
if (a[2]*s)%2==0:print(0)
else:print(s)
def dfs(v, tm):
    visited[v] = True
    dts[v] = est[v] = tm
    child = 0

    for i in range(nv):
        if adj[v][i]:
            if not visited[i]:
                child += 1
                parents[i] = v
                dfs(i, tm + 1)
                est[v] = min(est[v], est[i])

                if parents[v] is None and child > 1: aps[v] = True
                if parents[v] is not None and est[i] >= dts[v]: aps[v] = True

            elif parents[v] != i:
                est[v] = min(est[v], dts[i])

nv, ne = map(int, input().split(' '))
adj = [[False] * nv for _ in range(nv)]
est = [float('inf')] * nv
visited = [False] * nv
parents = [None] * nv
aps = [False] * nv
dts = [0] * nv

for _ in range(ne):
    s, t = map(int, input().split(' '))
    adj[s][t] = adj[t][s] = True

dfs(0, 0)

for i in range(nv):
    if aps[i]:
        print(i)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

def dfs(v, tm):
    dts[v] = est[v] = tm + 1
    child = 0

    for i in adj[v]:
        if est[i] == float('inf'):
            child += 1
            parents[i] = v
            dfs(i, tm + 1)
            est[v] = min(est[v], est[i])

            if parents[v] is None and child > 1: aps[v] = True
            if parents[v] is not None and est[i] >= dts[v]: aps[v] = True

        elif parents[v] != i:
            est[v] = min(est[v], dts[i])

nv, ne = map(int, input().split(' '))
adj = [[] for _ in range(nv)]
est = [float('inf')] * nv
parents = [None] * nv
aps = [False] * nv
dts = [0] * nv

for _ in range(ne):
    s, t = map(int, input().split(' '))
    adj[s].append(t)
    adj[t].append(s)

dfs(0, 0)

for i in range(nv):
    if aps[i]:
        print(i)
N = int(input())

y = []

for i in range(1, N//2):
    if N % i == 0:
        y.append( max( len(str(i)),  len(str(int(N/i))) ) )
print(min(y))

### FIXED CODE ###

N, M = map(int, input().split())
# ab = [int(x) for _ in range(N) for x in input().split()]
ab = [list(map(int, input().split())) for _ in range(N)]
cd = [list(map(int, input().split())) for _ in range(M)]

for st in range(len(ab)):
    dis = [abs(ab[st][0] - cd[cp][0]) + abs(ab[st][1] - cd[cp][1])  for cp in range(len(cd))]
    print(dis.index(min(dis))+1)
N, A, B, C, D = [int(i) for i in input().split()]
S = input()

def solve():
    ac, bd = S[A - 1:C], S[B - 1:D]
    if A < B < D < C:
        bd = S[B - 2:D + 1]
        return ("..." in bd and "##" not in ac)
    else:
        return ("##" not in ac and "##" not in bd)

if solve():
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S = input().replace("BC", "D")

ans = a = 0
for s in S:
    if s == "A":
        a += 1
    elif s == "D":
        ans += a
    else:
        a = 0

print(ans)
a = int(input())
b = int(input())

if (a+b>=24):
    print((a+b)-24)
else:
    print(a+b)

### FIXED CODE ###

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

A = a+b
B = A%24
print(B)
for e in iter(input,'0 0'):
 r=int(e.split()[0])
 d=[int(''.join(x),2)for x in zip(*[input().split()for _ in[0]*r])]
 a=0
 b=1<<r
 c=[1]*b
 for m in range(b):
  if c[m]:
   c[~m]=0
   t=0
   for s in d:
    c=bin(m^s).count('1')
    t+=c if c>r//2 else r-c
   if a<t:a=t
 print(a)


### FIXED CODE ###

def v():
 for e in iter(input,'0 0'):
  r=int(e.split()[0])
  d=[int(''.join(x),2)for x in zip(*[input().split()for _ in[0]*r])]
  a=0
  for m in range(1<<~-r):
   t=0
   for s in d:
    c=bin(m^s).count('1')
    t+=max(c,r-c)
   if a<t:a=t
  print(a)
if'__main__'==__name__:v()
S=input()

A=["SAT","FRI","THU","WED","TUE","MON","SUM"]

print(A.index(S)+1)

### FIXED CODE ###

S=input()

if S=="SAT":
    print(1)
elif S=="FRI":
    print(2)
elif S=="THU":
    print(3)
elif S=="WED":
    print(4)
elif S=="TUE":
    print(5)
elif S=="MON":
    print(6)
elif S=="SUN":
    print(7)
from collections import deque
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(m)]
g=[[]for _ in range(n)]

for a,b in ab:
  g[a-1].append(b-1)
  g[b-1].append(a-1)

def bfs(i,j):# iからjへのルートの数が2本以上あるかどうか。
  seen=[[-1]for _ in range(n)]
  seen[i]=[]
  todo=deque([[i]])
  c=0
  while len(todo)>0:
    d=todo.pop()
    l=g[d[-1]]
    for li in l:
      if li in d:
        continue
      if li==j:
        c+=1
        if c>1:
          return True
        continue
      e=d.copy()
      e.append(li)
      todo.append(e)
  return False

ans=0
for a,b in ab:
  ans+= 0 if bfs(a-1,b-1) else 1
print(ans)


### FIXED CODE ###

from collections import deque
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(m)]
g=[[]for _ in range(n)]

for a,b in ab:
  g[a-1].append(b-1)
  g[b-1].append(a-1)

def bfs(i,j):# iからjへのルートの数が2本以上あるかどうか。
  seen=[[-1]for _ in range(n)]
  seen[i]=[]
  todo=deque([[i]])
  c=0
  while len(todo)>0:
    d=todo.pop()
    l=g[d[-1]]
    for li in l:
      if li in d:
        continue
      if li==j:
        c+=1
        if c>1:
          return True
        continue
      e=d.copy()
      e.append(li)
      todo.append(e)
  return False

ans=0
for a,b in ab:
  ans+= 0 if bfs(a-1,b-1) else 1
print(ans)
N,K,Q = map(int, input().split())
score_lst = [0] * N

for i in range(Q):
    Ai = input()
    score_lst[Ai - 1] += 1

def_socre = K - Q
for j in score_lst:
    if def_socre + j > 0:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

N,K,Q = map(int, input().split())
score_lst = [0] * N

for i in range(Q):
    Ai = int(input())
    score_lst[Ai - 1] += 1

def_socre = K - Q
for j in score_lst:
    if def_socre + j > 0:
        print("Yes")
    else:
        print("No")
a, b, c = map(int, input().split())
if a == c: print("yes")
else: print("No")



### FIXED CODE ###

a, b, c = input()
if a == c:
    print("Yes")
else:
    print("No")
N=int(input())
A=list(map(int,input().split()))
dic={}
for i in set(A):
  dic[i]=A.count(i) 
def ans(k,dic):
  dic[A[k-1]]+=-1
  c=0
  for i in dic.values():
    c+=i*(i-1)/2
  dic[A[k-1]]+=1  
  return int(c)
for k in range(1,N+1):

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
dic={}
for a in A:
  if a in dic:
    dic[a]+=1
  else:
    dic[a]=1
   

c=0
for i in dic.values():
  c+=i*(i-1)/2
for j in range(1,N+1):
  d=c-dic[A[j-1]]+1
  print(int(d))
a,b,c = input().strip().split
a,b,c = [int(a), int(b), int(c)]

for i in range(c):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1

print('{} {}'.format(a, b))

### FIXED CODE ###

a,b,k = input().strip().split()
a,b,k = [int(a), int(b), int(k)]

if k <= a:
	a = a-k
elif k >= a+b:
	a = 0
	b = 0
elif a+b > k > a:
	b = b-(k-a)
	a = 0

print('{} {}'.format(a,b))
N,D = map(int,input(),split())
a = (N-1)//(2*D)
if (N-1)%(2*D) == 0:
	print(a)
else:
 	print((N-1)//(2*D+1))


### FIXED CODE ###

N,D = map(int,input().split())
a = N//(2*D+1)
if N%(2*D+1) == 0:
	print(a)
else:
 	print(a+1)
S=input()
num=0

for i in range(len(S)):
    num+=int(S[i])

if ((int)S%num)==0 :
    print("Yes")

else :
    print("No")

### FIXED CODE ###

n = input()
tmp = 0

for i in range(len(n)):
    tmp += int(n[i])
if(int(n)%tmp==0):
    print("Yes")
else:
    print("No")
# coding: utf-8
# Here your code !

import numpy

def func():
    try:
        (n,m) = tuple( [ int(num) for num in input().rstrip().split(" ") ] )
        matrix = numpy.array( [ [int(num) for num in input().rstrip().split(" ")] for i in range(n) ] )
        vector = numpy.array( [ int( input().rstrip() ) for i in range(m) ] )
    except:
        return inputError()

    result = numpy.dot(matrix,vector)
    for num in result:
        print(num)
    
def inputError():
    print("input error")
    return -1

func()

### FIXED CODE ###

# coding: utf-8
# Here your code !

def func():
    try:
        (n,m) = tuple( [ int(num) for num in input().rstrip().split(" ") ] )
        matrix = [ [int(num) for num in input().rstrip().split(" ")] for i in range(n) ]
        vector = [ int( input().rstrip() ) for i in range(m) ]
    except:
        return inputError()

    result = [ sum( [ matrix[j][i]*vector[i] for i in range(m) ] ) for j in range(n)  ] #????????¨??????????????????

    for num in result:
        print(num)
    
def inputError():
    print("input error")
    return -1

func()
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

D = abs(A-B)
E = V - W
time = float(D/E)
if E <= 0:
	print("NO")
else:
	if time <= T:
		print("YES")
	else:
		print("NO")

### FIXED CODE ###

A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

D = float(abs(A-B))
E = float(V - W)

if E <= 0:
	print("NO")
	exit()
time = D/E
if time <= T:
	print("YES")
else:
	print("NO")
# @author 

import sys

class EVirusTree2:

    def solve(self):
        from collections import defaultdict
        import sys
        # sys.setrecursionlimit(10 ** 5 + 5)

        MOD = 10 ** 9 + 7
        n, k  = [int(_) for _ in input().split()]
        adj = defaultdict(list)
        for i in range(n - 1):
            a, b = [int(_) for _ in input().split()]
            a -= 1
            b -= 1
            adj[a].append(b)
            adj[b].append(a)
        done = [0] * n
        def dfs(s, rem):
            done[s] = 1
            if rem < 0:
                return 0
            res = 1
            for x in adj[s]:
                if done[x]:
                    continue
                if rem <= 0:
                    return 0
                res = (res * rem) % MOD
                res = (res * dfs(x, k - 2)) % MOD
                rem -= 1
                if res == 0:
                    return 0
            return res

        print (dfs(0, k - 1) * k) % MOD




solver = EVirusTree2()
input = sys.stdin.readline

solver.solve()


### FIXED CODE ###

# @author 

import sys

class EVirusTree2:

    def solve(self):
        from collections import defaultdict
        import sys
        sys.setrecursionlimit(10 ** 5 + 5)

        MOD = 10 ** 9 + 7
        n, k  = [int(_) for _ in input().split()]
        adj = defaultdict(list)
        for i in range(n - 1):
            a, b = [int(_) for _ in input().split()]
            a -= 1
            b -= 1
            adj[a].append(b)
            adj[b].append(a)
        done = [0] * n
        def dfs(s, rem):
            done[s] = 1
            if rem < 0:
                return 0
            res = 1
            for x in adj[s]:
                if done[x]:
                    continue
                if rem <= 0:
                    return 0
                res = (res * rem) % MOD
                res = (res * dfs(x, k - 2)) % MOD
                rem -= 1
                if res == 0:
                    return 0
            return res

        print((dfs(0, k - 1) * k) % MOD)




solver = EVirusTree2()
input = sys.stdin.readline

solver.solve()
import sys

args = sys.argv
r = int(args[1])
g = int(args[2])
b = int(args[3])

mul = r*100 + g*10 * b

if mul % 4 == 0:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

r,g,b = [int(x) for x in input().split()]

mul = r*100 + g*10 + b

if mul % 4 == 0:
    print("YES")
else:
    print("NO")
import numpy as np
# 参加人数を入力する
N = int(input())
# レートを入力する
a = list(map(int, input().split()))
# ndarray型に変換
arr_a = np.array(a)
# 3200未満のレートを持つ人について、色の種類数を設定する
under3200 = 0
# 色ごとのレートの下限と上限を設定
lower = 1
upper = 399
# 上限が3200未満である限り繰り返す
while upper < 3200:
    # 範囲内のレートを持つ人がいる場合、色の種類数を増やす
    if len(arr_a[(arr_a  >= lower) & (arr_a <= upper)]) != 0:
        under3200 += 1
    # 下限と上限を更新する
    lower = upper + 1
    upper += 400
# 3200を超えるレートを持つ人の数を数える
over3200 = len(arr_a[arr_a >= 3200])

# 色の種類数の最小値について
if under3200 != 0:
    under3200
else:
    min_color = 1
# 色の種類数の最大値について
max_color = under3200 + over3200
# 結果を出力する
print("{} {}".format(min_color, max_color))

### FIXED CODE ###

import numpy as np
# 参加人数を入力する
N = int(input())
# レートを入力する
a = list(map(int, input().split()))
# ndarray型に変換
arr_a = np.array(a)
# 3200未満のレートを持つ人について、色の種類数を設定する
under3200 = 0
# 色ごとのレートの下限と上限を設定
lower = 1
upper = 399
# 上限が3200未満である限り繰り返す
while upper < 3200:
    # 範囲内のレートを持つ人がいる場合、色の種類数を増やす
    if len(arr_a[(arr_a  >= lower) & (arr_a <= upper)]) != 0:
        under3200 += 1
    # 下限と上限を更新する
    lower = upper + 1
    upper += 400
# 3200を超えるレートを持つ人の数を数える
over3200 = len(arr_a[arr_a >= 3200])

# 色の種類数の最小値について
if under3200 != 0:
    min_color = under3200
else:
    min_color = 1
# 色の種類数の最大値について
max_color = under3200 + over3200
# 結果を出力する
print("{} {}".format(min_color, max_color))
W,H,x,y,r=map(int,input().split())
if (x+r<W&&r<x&&r<y&&y+r<H):
 print("Yes")
else :
 print("No")

### FIXED CODE ###

W,H,x,y,r=map(int,input().split())
if not (x+r>W or r>x or r>y or y+r>H):print("Yes")
else:print("No")
n = int(input())
    t = 1
    while True:
        if t * 2 > n:
		break
	t *= 2
    print(t)



### FIXED CODE ###

n = int(input())
t = 1
while True:
	if t * 2 > n:
		break
	t *= 2
print(t)
n,T=map(int,input().split())
ans=[]
for i in range(n):
    c,t=map(int,input().split())
    if t<=T:
        ans.append(c)
print(min(ans))        
        
    

### FIXED CODE ###

n,T=map(int,input().split())
ans=[]
for i in range(n):
    c,t=map(int,input().split())
    if t<=T:
        ans.append(c)
if len(ans)==0:
  print("TLE")
else:
  print(min(ans))
input()
nums = [int(i)-1 for i in input().split()]
c = 0

for i, j in enumerate(nums):
	if i == j:
		nums[i], nums[i+1] = nums[i+1], nums[i]
		c += 1
print(c)



### FIXED CODE ###

input()
nums = [int(i)-1 for i in input().split()]
c = 0

for i, j in enumerate(nums):
	if i == j and i != len(nums) - 1:
		nums[i], nums[i+1] = nums[i+1], nums[i]
		c += 1
	elif i == j and i == len(nums) - 1:
		nums[i], nums[0] = nums[0], nums[i]
		c += 1
print(c)
N = int(input())
t = [0] * (N+1)
x = [0] * (N+1)
y = [0] * (N+1)
D = [0] * N
T = [0] * N
for i in range(N):
  t[i+1], x[i+1], y[i+1] = map(int, input().split())
for i in range(N-1):
  D[i] = abs(x[i+1]-x[i]) + abs(y[i+1]-y[i])
  T[i] = t[i+1] - t[i]
ans = 'Yes'
for i in range (N-1):
  if D[i] <= T[i] and (D[i] - T[i])%2 == 0:
    ans = 'Yes'
  else:
    ans = 'No'
print(ans)

### FIXED CODE ###

a , b = map(int, input().split())
c = a*b
if c%2 == 1:
  print("Odd")
else:
  print("Even")
A, B, C = list(map(int, input().split()))

A, B = B, A
A, C = C, A
print(A, B, C)A, B, C = list(map(int, input().split()))

A, B = B, A
A, C = C, A
print(A, B, C)

### FIXED CODE ###

A, B, C = list(map(int, input().split()))

A, B = B, A
A, C = C, A
print(A, B, C)
N = int(input())
ans = 0

from math import sqrt
ans = 0
for k in range(1,int(sqrt(N)+1)):
    if N%k == 0:
        m = N//k-1
        if k == N%m: ans += m

print(ans)

### FIXED CODE ###

N = int(input())

from math import sqrt
ans = 0
if N != 1:
    for k in range(1,int(sqrt(N)+1)):
        if N%k == 0:
            m = N//k-1
            if k == N%m: ans += m

print(ans)
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
ls = [A,B,C,D,E]

#1の位
A1 = int(str(A)[-1])
B1 = int(str(B)[-1])
C1 = int(str(C)[-1])
D1 = int(str(D)[-1])
E1 = int(str(E)[-1])

flag=0
ls1 = [A1,B1,C1,D1,E1]
if ls1 == [0,0,0,0,0]:
    flag=1
j=0
for i in ls1:
    if i==0:
        ls1[j]=9
    j+=1

j=0
last = min(ls1)
for i in  ls1:
    #print(i)
    if i == last:
        las = j  #最後に注文するやつのindex
    j+=1

k=0
for i in ls:
    for j in range(1,14):
        if i <= j*10:
            ls[k] = j*10
            break
    k+=1

ls[las] -= (10 - last)
#print(ls)
if flag==0:
    print(sum(ls))
else:
    print(sum(A,B,C,D,E))


### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
ls = [A,B,C,D,E]

#1の位
A1 = int(str(A)[-1])
B1 = int(str(B)[-1])
C1 = int(str(C)[-1])
D1 = int(str(D)[-1])
E1 = int(str(E)[-1])

flag=0
ls1 = [A1,B1,C1,D1,E1]
if ls1 == [0,0,0,0,0]:
    flag=1
j=0
for i in ls1:
    if i==0:
        ls1[j]=9
    j+=1

j=0
last = min(ls1)
for i in  ls1:
    #print(i)
    if i == last:
        las = j  #最後に注文するやつのindex
    j+=1

k=0
for i in ls:
    for j in range(1,14):
        if i <= j*10:
            ls[k] = j*10
            break
    k+=1

ls[las] -= (10 - last)
#print(ls)
if flag==0:
    print(sum(ls))
else:
    print(sum([A,B,C,D,E]))
[a,b]=map(int,input(),split())
print(a*b,(a+b)*2)

### FIXED CODE ###

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