Harryxun/stf_run huggingface dataset:
N = int(input())
a = list(map(lambda x: int(x) // 400, input().split()))
s_a = []
b_a = []

for i in range(N):
    if a[i] <= 7:
        s_a.append(a[i])
    else:
        b_a.append(a[i])

if len(s_a) == 0:
    min = 1
else:
    min = len(set(s_a))

if len(set(s_a)) + len(b_a) <= :
    max = len(set(s_a)) + len(b_a)
else:
    max = 7

print(min, max)

### FIXED CODE ###

N = int(input())
a = list(map(lambda x: int(x) // 400, input().split()))
s_a = []
b_a = []

for i in range(N):
    if a[i] <= 7:
        s_a.append(a[i])
    else:
        b_a.append(a[i])

if len(s_a) == 0:
    min = 1
else:
    min = len(set(s_a))


max = len(set(s_a)) + len(b_a)


print(min, max)
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9
    N=I()
    from math import gcd
    from collections import defaultdict
    dd = defaultdict(int)
    temp0=0

    for i in range(N):
        a,b=MI()
        if a*b==0:
            assert 0
        
        if (a,b)==(0,0):
            temp0+=1
            continue
        
        if a<0:
            a*=-1
            b*=-1
        
        #(+,+)と(+,-)だけにする
        if a*b!=0:
            g=gcd(abs(a),abs(b))
            a=a//g
            b=b//g
            if a*b>0:#(+,+)
                dd[(a,b)]+=1
                dd[b,-a]+=0
                
            else:#(+,-)
                dd[(a,b)]+=1
                dd[(-b,a)]+=0
            
        elif (a,b)!=(0,0):
            #assert 0
            if a==0:
                b=1
            else:
                a=1
                
            dd[(a,b)]+=1
            dd[(b,a)]+=0
        

    ans=1
    
    for k,v in dd.items():
        a,b=k
        if b<=0:
            continue
        #+,+だけ見る
        
        if a*b!=0:
            v=dd[k]
            v2=dd[(b,-a)]
        else:
            v=dd[k]
            v2=dd[(b,a)]
        temp=pow(2,v,mod)+pow(2,v2,mod)-1
        
        ans=(ans*temp)%mod

    ans=(ans-1+temp0)%mod
    print(ans)
        
        
            
            
    #せんぶ０の組みをひく
        
    

main()


### FIXED CODE ###



def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    from math import gcd
    from collections import defaultdict
    dd = defaultdict(int)
    temp0=0

    for i in range(N):
        a,b=MI()
        if (a,b)==(0,0):
            temp0+=1
            continue
        
        if a<0:
            a*=-1
            b*=-1
        
        #(+,+)と(+,-)だけにする
        if a*b!=0:
            g=gcd(a,b)
            a=a//g
            b=b//g
            if a*b>0:#(+,+)
                dd[(a,b)]+=1
                dd[b,-a]+=0
                
            else:#(+,-)
                dd[(a,b)]+=1
                dd[(-b,a)]+=0
            
        elif (a,b)!=(0,0):
            #assert 0
            if a==0:
                b=1
            else:
                a=1
                
            dd[(a,b)]+=1
            dd[(b,a)]+=0
        

    ans=1
    
    for k,v in dd.items():
        a,b=k
        if b<=0:
            continue
        #( +,+)と(0,1)だけ見る
        
        if a*b!=0:
            v=dd[k]
            v2=dd[(b,-a)]
        else:
            v=dd[k]
            v2=dd[(b,a)]
        temp=pow(2,v,mod)+pow(2,v2,mod)-1
        
        ans=(ans*temp)%mod

    ans=(ans-1+temp0)%mod
    print(ans)
        
        
            
            
    #せんぶ０の組みをひく
        
    

main()
s = input()
a = 0
ans = 0
b = 0
d = []
e = []
now = 0

for i in range(len(s)):
    if s[i] == '<':
        
        if a != 0:
            if a > now:
                ans = ans - d[-1] + a
                
            for j in range(a):
                ans = ans + j
                d.append(a - j)
                e.append(">")
            now = 0
            a = 0
        
        ans = ans + now + 1
        now = now + 1
        d.append(now)
        
    else:
        a = a + 1
        b = 0
    
if a != 0:
    if a > now:
        ans = ans - d[-1] + a
                
    for j in range(a):
        ans = ans + j
        d.append(a - j)
        e.append(">")
    
print(ans)

### FIXED CODE ###

s = input()
a = 0
ans = 0
b = 0
d = [0]
e = []
now = 0

for i in range(len(s)):
    if s[i] == '<':
        
        if a != 0:
            if a > now:
                ans = ans - d[-1] + a
                
            for j in range(a):
                ans = ans + j
                d.append(a - j)
                e.append(">")
            now = 0
            a = 0
        
        ans = ans + now + 1
        now = now + 1
        d.append(now)
        
    else:
        a = a + 1
        b = 0
    
if a != 0:
    if a > now:
        ans = ans - d[-1] + a
                
    for j in range(a):
        ans = ans + j
        d.append(a - j)
        e.append(">")
    
print(ans)
n, k = map(int, input().split())
a = input().split()

for i in range(10*n - n):
    c = str(n+i)
    
    for j in a:
        if j in c:
            break
    
    else:
        ans = c
        break
        
print(ans)

### FIXED CODE ###

ans = [5,5,7]
a = sorted(list(map(int, input().split())))
if a == ans:
    print("YES")
else:
    print("NO")
import math
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
m = 0
for i in range(n):
    b = a.copy()
    b[i:i+1] = []
    g = reduce(math.gcd,b)
    m = max(m,g)
print(m)

### FIXED CODE ###

def gcd(x,y):
    while y != 0:
        x,y = y,x%y
    return x
n = int(input())
a = list(map(int,input().split()))

L,R = [0],[0]
for i in range(1,n+1): #L[i]は左i個,R[i]は右i個
    L.append(gcd(L[-1],a[i-1]))
    R.append(gcd(R[-1],a[n-i]))
print(max(gcd(L[i],R[n-i-1]) for i in range(n)))
a,b=map(int,input().split())

tmp=0
for i in range(1,a):
  if tmp<a:
    tmp+=i
  else:
    break
print(tmp+i-b)

### FIXED CODE ###

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

print(int((b-a)*(b-a+1)/2-b))
import numpy as np

# Calculate intensity
N, K = [int(v) for v in input().split(" ")]
A_arr = np.array([int(v) for v in input().split(" ")])
step = np.arange(len(A_arr))
print("0")
exit()
def Luminate(A_arr, i):
  isLuminated = np.abs(step - i) < A_arr
  return isLuminated

def get_Intensity(A_arr):
  return np.array([np.sum(Luminate(A_arr, i)) for i in range(len(A_arr))])
Intensity = A_arr
for i in range(K):
  Intensity = get_Intensity(Intensity+1)
  if np.sum(Intensity) == N**2:
    break
print(" ".join([str(v) for v in Intensity]))


### FIXED CODE ###

S = input()

nickname = S[0:3]
print(nickname)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = str(input())
print(n)
l1 = []
for c in n:
	l1.append(c)

z, o = '0', '1'

one, zero = [], []

for i in range(len(l1)):
	if i%2 == 0:
		one.append(o)
		zero.append(z)
	else:
		one.append(z)
		zero.append(o)

c1, c2 = 0,0
for i in range(len(l1)):
	if l[i] == one[i]:
		c1 += 1
	if l[i] == zero[i]:
		c2 += 1

ans = min(c1, c2)
print(ans)

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = str(input())
l1 = []
for c in n:
	l1.append(c)

z, o = '0', '1'

one, zero = [], []

for i in range(len(l1)):
	if i%2 == 0:
		one.append(o)
		zero.append(z)
	else:
		one.append(z)
		zero.append(o)

c1, c2 = 0,0
for i in range(len(l1)):
	if l1[i] == one[i]:
		c1 += 1
	if l1[i] == zero[i]:
		c2 += 1

ans = min(c1, c2)
print(ans)
import sys

n = int(input())
l = []
p = None

for i in range(n):
  s = input()
  if s in l && (p == None || p[-1:] == s[1:]):
    l.append(s)
    p = s
  else:
    print("No")
    sys.exit()
print("Yes")

### FIXED CODE ###

import sys
 
n = int(input())
l = []
p = None
 
for i in range(n):
  s = input()
  if s not in l and (p == None or p[-1:] == s[:1]):
    l.append(s)
    p = s
  else:
    print("No")
    sys.exit()
print("Yes")
s = input()
for i in range(len(s)):
  s[i] = x
print(s)

### FIXED CODE ###

s = input()
a = ""
for i in range(len(s)):
  a += "x"
print(a)
n= int(input())
a = list(int(i) for i in input().split())
import math
import sys

sta=sum(a)/2
sum=0
ans=0
for i in range(0,n-1):
    if sum==sta:
        print(0)
        sys.exit()
    elif sum<sta and sum+a[i+1]>sta:
        ans=min(sta-sum,sum+a[i]-sta)/0.5
        print(int(ans))
        sys.exit()
    else:
        sum+=a[i]

ans=min(sta-sum,sum+a[n]-sum)/0.5
print(ans)

### FIXED CODE ###

n= int(input())
a = list(int(i) for i in input().split())
import math
import sys

sta=sum(a)/2
sum=0
ans=0
for i in range(0,n-1):
    if sum==sta:
        print(0)
        sys.exit()
    elif sum<sta and sum+a[i]>sta:
        ans=min(sta-sum,sum+a[i]-sta)/0.5
        print(int(ans))
        sys.exit()
    else:
        sum+=a[i]

ans=min(sta-sum,sum+a[n-1]-sta)/0.5
print(abs(int(ans)))
import sys
s=raw_input()
flag=False
for j in range(s):
    if s[j]=='C':
        flag=True
    if s[j]=='F' and flag:
        print "Yes"
        sys.exit()
print "No"

### FIXED CODE ###

import sys
s=raw_input()
flag=False
for j in range(len(s)):
    if s[j]=='C':
        flag=True
    if s[j]=='F' and flag:
        print "Yes"
        sys.exit()
print "No"
N, M = map(int, input().split())
LRD = [list(map(int, input().split())) for i in range(M)]


class WeightedUnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n + 1)
        self.weight = [0] * (n+1)

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.weight[x] += self.weight[self.par[x]]
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 重さの検索
    def weighting(self, x):
        self.find(x)
        return self.weight[x]

    # 併合
    def union(self, x, y, w):
        w -= self.weighting(x)
        w += self.weighting(y)
        x = self.find(x)
        y = self.find(y)

        if self.rank[x] < self.rank[y]:
            self.weight[y] = w
            self.par[y] = w
            self.find(x)
            self.find(y)
        else:
            self.weight[y] = -w
            self.par[y] = x
            self.find(x)
            self.find(y)
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # 各頂点間の絶対距離
    def diff(self, x, y):
        return self.weighting(x) - self.weighting(y)


wuf = WeightedUnionFind(N)
for l, r, d in LRD:
    if wuf.same(l, r):
        if wuf.diff(l, r) != d:
            print("No")
            break
    else:
        wuf.union(l, r, d)
else:
    print("Yes")


### FIXED CODE ###

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


class WeightedUnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        self.weight = [0] * (n+1)

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            y = self.find(self.par[x])
            self.weight[x] += self.weight[self.par[x]]
            self.par[x] = y
            return y

    # 重さの検索
    def weighting(self, x):
        self.find(x)
        return self.weight[x]

    # 併合
    def union(self, x, y, w):
        px = self.find(x)
        py = self.find(y)
        if px != py:
            if self.rank[px] < self.rank[py]:
                self.par[px] = py
                self.weight[px] = w - self.weight[x] + self.weight[y]
            else:
                self.par[py] = px
                self.weight[py] = -w - self.weight[y] + self.weight[x]
                if self.rank[px] == self.rank[py]:
                    self.rank[px] += 1

    # 同じ集合に属するか
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # 各頂点間の絶対距離
    def diff(self, x, y):
        return self.weight[x] - self.weight[y]

wuf = WeightedUnionFind(N)
for l, r, d in LRD:
    if wuf.same(l, r):
        if wuf.diff(l, r) != d:
            print("No")
            break
    else:
        wuf.union(l, r, d)
else:
    print("Yes")
s = st(input())
string = list(s)
cnt = sum(string)
print("x" * int(cnt))

### FIXED CODE ###

s = str(input())
string = list(s)
cnt = len(string)
print("x" * cnt)
from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

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

if sum(n)%9==0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import math

N=int(input())
if N%9==0:
    print('Yes')
else:
    print('No')
def resolve():
    '''
    code here
    '''
    import collections
    N = int(input())
    D = [int(item) for item in input().split()]

    d_dict = collections.Counter(D)

    if D[0] != 0:
        print(0)
    else:
        cnt = 1
        for i, v in d_dict.items():
            if i >0 :
                if v > 2:
                    cnt *= (v-1)*(v-2)
                elif v == 2:
                    cnt *=  2
                elif v == 1:
                    cnt *= 1

    print(cnt)

if __name__ == "__main__":
    resolve()


### FIXED CODE ###

def resolve():
    '''
    code here
    '''
    import collections
    N = int(input())
    D = [int(item) for item in input().split()]
    d_dict = collections.Counter(D)

    cnt = 0
    if D[0] != 0:
        pass
    else:
        cnt = 1
        for i in D[1:]:
            cnt *= d_dict[i-1]
            cnt %= 998244353


    print(cnt % 998244353)

if __name__ == "__main__":
    resolve()
A,B=int(input().split())
if 1<=A<=9 and 1<=B<=9:
    print(A*B)
else:
    print(-1)

### FIXED CODE ###

a,b=map(int,input().split())
if 1<=a<=9 and 1<=b<=9:
  print(a*b)
else:
  print(-1)
import sys

n,m = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(m)]

sc.sort(key=lambda x:x[0])
sc.sort()
anl =[0 for i in range(n)]
an = 0

if sc[0][1]==0:
    if n>1:
        print('-1')
        sys.exit()
    else:
        print(0)
        sys.exit()

for i in range(m):
    for j in range(1,m):
        if sc[i][0] == sc[j][0] and sc[i][1]!=sc[j][1]:
            print('-1')
            sys.exit()
        else:
            anl[sc[i][0]-1] = sc[i][1]

if anl[n-1]==0:
    print('-1')
    sys.exit()

for i in range(n):
    an += 10**(n-i-1)*anl[i]
print(an)

### FIXED CODE ###

import sys

def ans(anl,n):
    an = 0
    for i in range(n):
        an += 10**(n-i-1)*anl[i]
    return(an)

n,m = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(m)]

sc.sort(key=lambda x:x[0])
sc.sort()
anl =[0 for i in range(n)]
anl[0] = 1

if m == 0:
    if n == 1:
        print(0)
        sys.exit()
    else:
        print(10**(n-1))
        sys.exit()
if m == 1:
    if sc[0][1] == 0 and n == 1:
        print(0)
        sys.exit()
    anl[sc[0][0]-1] = sc[0][1]
    if anl[0] == 0:
        print('-1')
        sys.exit()
    print(ans(anl,n))
    sys.exit()

for i in range(m):
    for j in range(1,m):
        if sc[i][0] == sc[j][0] and sc[i][1]!=sc[j][1]:
            print('-1')
            sys.exit()
        else:
            anl[sc[i][0]-1] = sc[i][1]

if anl[0] == 0:
    print('-1')
    sys.exit()

print(ans(anl,n))
N=int(input())
A=list(map(int,input().split()))
cnt=0
for i in range(N):
  if i+1==A[i]:
    a=A[i]
    b=A[i+1]
    A[i]=b
    A[i+1]=a
    cnt+=1
print(cnt)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
cnt=0
for i in range(N-1):
  if i+1==A[i]:
    a=A[i]
    b=A[i+1]
    A[i]=b
    A[i+1]=a
    cnt+=1
if A[-1]==N:
  cnt+=1
print(cnt)
n = int(input())
a = list(map(int, input().split()))
k=[]
for i in range(1, n + 1):
  k.insert(0, a.index(i) + 1)
print(k[l] for l in range(n). end =' ')
    


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = [0]* N
for i in range(N):
    B[A[i]-1] = i + 1
print(*B)
red blue
5 5
blue

### FIXED CODE ###

S,T = input().split()
a,b = map(int, input().split())
U = input()
if U == S:
    print(a-1,b)
else:
    print(a,b-1)
C = input()
 
if C.isupeer:
  print("A")
else:
  print("a")

### FIXED CODE ###

if input().isupper():
  print("A")
else:
  print("a")
# coding: utf-8
A=input('数字を入力＞')
op=raw_input('＋又はーを入力＞')
B=input('数字を入力>')
if op == '+':
    print(int(A)+int(B))
else:
    print(int(A)-int(B))


### FIXED CODE ###

# -*- coding: utf-8 -*-

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

if op == '+':
    print(int(a) + int(b))
else:
    print(int(a) - int(b))
S = input()
T = input()
cnt = 0
for i, v in enumerate(zip(S,T)):
  if v[0] == v[1]:
    continue
  else:
    S[i] = v[1]
    cnt += 1
print(cnt)


### FIXED CODE ###

S = input()
T = input()
cnt = 0
for i, v in enumerate(zip(S,T)):
  if v[0] == v[1]:
    continue
  else:
    cnt += 1
print(cnt)
S = input()
k = int(input())
for i, s in enumerate(S):
  if s == "1" and i+1==k:
    print(s)
    break()
  else:
    print(s)
    break


### FIXED CODE ###

S = input()
k = int(input())
d = {}
cnt = 0
for i, s in enumerate(S):
  if s == "1":
    cnt += 1
    if i+1 == k:
      print(s)
      exit()
  else:
    print(s)
    exit()
if cnt == len(S):
  print("1")
import sys

INF = int(1e9)

memo = [-1 for i in range(100000)]

def dp(at):
  if at >= n-1: return 0
  if memo[at] != -1: return memo[at]
  memo[at] = min((dp(at+1)+abs(stones[at]-stones[at+1])), (dp(at+2)+abs(stones[at]-stones[at+2])))
  return memo[at]

n = int(sys.stdin.readline())

stones = map(int, sys.stdin.readline().split())
stones.append(INF)
stones.append(INF)
print dp(0)

### FIXED CODE ###

import sys

sys.setrecursionlimit(10**8)

INF = int(1e9)

memo = [-1 for i in range(100000)]

def dp(at):
  if at >= n-1: return 0
  if memo[at] != -1: return memo[at]
  memo[at] = min((dp(at+1)+abs(stones[at]-stones[at+1])), (dp(at+2)+abs(stones[at]-stones[at+2])))
  return memo[at]

n = int(sys.stdin.readline())

stones = map(int, sys.stdin.readline().split())
stones.append(INF)
stones.append(INF)
print dp(0)
def calcurate_digit_sum(num):
    num_str = str(num)
    digit_sum = 0
    for i, digit in enumerate(num_str):
        digit_sum += int(digit)

    return digit_sum

def check_harshad(num):
    digit_sum = calcurate_digit_sum(num)
    if num % digit_sum == 0:
        return("yes")
    return("no")

if __name__ == "__main__":
    N = int(input())
    print(check_harshad(N))

### FIXED CODE ###

def plan_one(time, price_base):
    price = time * price_base
    return price

if __name__ == "__main__":
    input_list = input().split(" ")
    N, A, B = int(input_list[0]), int(input_list[1]), int(input_list[2])
    price = min(plan_one(N, A), B)
    print(price)
def actual(N, s_list):
    return len(set(s_list))

N = int(input())

s_list = []

for _ in range(N)
	s = input()
  	s_list.append(s)
    
print(actual(N, s_list))   

### FIXED CODE ###

def actual(N, s_list):
    return len(set(s_list))

N = int(input())

s_list = []

for _ in range(N):
  s = input()
  s_list.append(s)
    
print(actual(N, s_list))
A = list()
B = [0] * 200000

for i in range(N):
  i = int(input())
  A.append(i)
  
C = sorted(A,reverse=True)

for k in range(N):
  if max(A) != A[k]:
    print(C[0])
  else:
    B[k] = A[k]
    A[k] = 0
    print(max(A))
    A[k] = B[k]

### FIXED CODE ###

N = int(input())
A = list()

for i in range(N):
  i = int(input())
  A.append(i)
  
ma = max(A)
sa = sorted(A)

for k in range(N):
  if ma != A[k]:
    print(ma)
  else:
    print(sa[-2])
a = input().split()
s=a[0]
t=a[1]
print(t&s)

### FIXED CODE ###

a = input().split()
s=a[0]
t=a[1]
print(t+s)
N = int(input())
a = list(map(int,input().split()))
ans = 0
now = a[0]
i = 1
while i < N:
    if now == a[i]:
        ans += 1
        i += 2
        if i == N-1:
            break
        now = a[i+1]
    else:
        now = a[i]
        i += 1
print(ans)


### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
ans = 0
now = a[0]
i = 1
while i < N:
    if now == a[i]:
        ans += 1
        if i == N-1:
            break
        now = a[i+1]
        i += 2
        
    else:
        now = a[i]
        i += 1
print(ans)
n = int(input())
a = [int(input()) for i in range(n)]
m = max(a)

k = [i for i, x in enumerate(a) if x == m]

if len(k)>=2:
	for i in range(n):
		print(m)
else:
	b = a
	b.pop(m)
	m2 = max(b)
	for i in range(n):
		if i != m:
			print(m)
		else:
			print(m2)

### FIXED CODE ###

n = int(input())
a = [int(input()) for i in range(n)]
m = max(a)

k = [i for i, x in enumerate(a) if x == m]

if len(k)>=2:
	for i in a:
		print(m)
else:
	b = []
	b += a
	mi = b.index(m)
	b.pop(mi) 
	m2 = max(b)
	for i in a:
		if i != m:
			print(m)
		else:
			print(m2)
a, b, c = map(int, raw_input().split())
 
if a < b and b < c:
 print yes
else:
 print no

### FIXED CODE ###

a, b, c = map(int, raw_input().split())
  
if a < b and b < c:
 print "Yes"
else:
 print "No"
n = []
while True:
    try:
        n.append(int(raw_input()))
    except:
        break
  
R = max(n)+1
sqrt = int(math.sqrt(r))
p = [1]*R
p[0] = p[1] = 0
i = 2
while i*i < n:
    if p[i]:
        p[2*i::i] = [0 for x in range(2*i,R,i)]
    i += p[i+1:].index(1)+1
for i in n:
     print sum(p[:i+1])

### FIXED CODE ###

import math
n = []
while True:
    try:
        n.append(int(raw_input()))
    except:
        break
  
r = max(n)+1
sqrt = int(math.sqrt(r))
p = [1]*r
p[0] = 0
p[3::2] = [0 for x in range(3,r,2)]
for i in range(2,sqrt,2):
    if p[i]:
        p[2*i+1::i+1] = [0 for x in range(2*i+1,r,i+1)] 
  
for i in n:
     print sum(p[:i])
s = input()
k = int(input())


for i, v in enumerate(s):
    if v != "1":
        break
after = "1" * i + v * 100
print(after[min(len(s), k)])


### FIXED CODE ###

s = input()
k = int(input())

import random
for i, v in enumerate(s):
    if v != "1":
        break
after = "1" * i + v * 100
print(after[min(len(s), k) - 1])
n = input()
x = (n-2)*180
print(x)

### FIXED CODE ###

n = int(input())
x = (n-2)*180
print(x)
import math
def nCr(n, r): 
  
    return (math.fact(n) // (math.fact(r)  
                * math.fact(n - r))) 
n,m=list(map(int,input().split()))
total=0
if n>1:
  total+=nCr(n,2)
if m>1:
  total+=nCr(m,2)
print(total)


### FIXED CODE ###

import math
def nCr(n, r): 
  
    return (math.factorial(n) // (math.factorial(r)  
                * math.factorial(n - r))) 
n,m=list(map(int,input().split()))
total=0
if n>1:
  total+=nCr(n,2)
if m>1:
  total+=nCr(m,2)
print(total)
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
if c11==c23 and c12==c22 and c13==c21:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

a=input()
b=input()
if a==b[::-1]:
    print("YES")
else:
    print("NO")
N=int(input())
num={}
for a in input().split():
  num[a]+=1
ans=0
for k,v in num:
  if k>v:
    ans+=v
  else:
    ans+=v-k
print(ans)

### FIXED CODE ###

import collections
N=int(input())
A=[int(a) for a in input().split()]
c=collections.Counter(A)
ans=0
for k,v in c.items():
  if k>v:
    ans+=v
  else:
    ans+=v-k
print(ans)
str=input()
n=int(input())
for i in range(n):
    s=input().split()
    a=int(s[1])
    b=int(s[2])
    if s[0] == 'replace':
        str=str[:a]+s[3]+str[b:]
    elif s[0] == 'reverse':
        str=str[:a]+reversed(str[a:b])+str[b:]
    else:
        print(str[a:b])

### FIXED CODE ###

str=input()
n=int(input())
for i in range(n):
    s=input().split()
    a=int(s[1])
    b=int(s[2])
    if s[0] == 'replace':
        str=str[:a]+s[3]+str[b+1:]
    elif s[0] == 'reverse':
        str=str[:a]+str[a:b+1][::-1]+str[b+1:]
    else:
        print(str[a:b+1])
n = 1
x = int(input())
while x != 0 :
    print("Case {}:{}".format(n,x)
    n = n+1
    x = int(input())


### FIXED CODE ###

n = 1
x = int(input())
while x != 0 :
    print("Case {}: {}".format(n,x))
    n = n+1
    x = int(input())