Harryxun/stf_run huggingface dataset:
n = inta(input())
c = 0
for _ in range(n):
    data = int(input())
    for i in range(2,data):
        if(data%i == 0):
            c += 1
            break
print(c)


### FIXED CODE ###

def is_prime(n):
    for i in range(2,n):
        if i*i > n:
            return True
        if n%i == 0:
            return False
    return True
c = 0
n = int(input())
for _ in range(n):
    data = int(input())
    if is_prime(data): c+= 1
print(c)
from math import gcd
k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        n = math.gcd(i,j)
        for m in range(1,k+1):
            a = math.gcd(n,m)
            ans += a
print(ans)


### FIXED CODE ###

from math import gcd
k=int(input())
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        ans_=gcd(i,j)
        for l in range(1,k+1):
            ans+=gcd(ans_,l)
print(ans)
I = int(input()) for i in range(6):

I[0] = a
I[5] = e
I[6] = k

if e-a > k:
	print(':(')
else :
	print('Yay!')

### FIXED CODE ###

I =[int(input())for i in range(6)]

if I[4] - I[0] > I[5] :
	print(":(")
else :
	print("Yay!")
# https://beta.atcoder.jp/contests/abc058/tasks/abc058_b

from itertools import zip_longest


def solve():
    o = input()
    e = input()
    for l, r in zip_longest(o, e):
        if r is None:
            r = ""
        print(f'{l}{r}', end="")


if __name__ == '__main__':
    solve()


### FIXED CODE ###

# https://beta.atcoder.jp/contests/abc058/tasks/abc058_b


def solve():
    o = input()
    e = input()

    for l, r in zip(o, e):
        print('{}{}'.format(l, r), end="")

    if len(o) != len(e):
        print(o[-1])
    else:
        print()


if __name__ == '__main__':
    solve()
N, M = map(int,input().split())
L = []
R = []
for i in range(M):
    tmp_L, tmp_R = input().split()
    L.append(tmp_L)
    R.append(tmp_R)

left = max(L)
right = min(R)

if right - left < 0:
    print(0)
else:
    print(right - left + 1)

### FIXED CODE ###

N, M = map(int,input().split())
L = []
R = []
for i in range(M):
    tmp_L, tmp_R = map(int,input().split())
    L.append(tmp_L)
    R.append(tmp_R)

left = max(L)
right = min(R)

if right - left < 0:
    print(0)
else:
    print(right - left + 1)
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
if a+k-1 < b-k+1:
  s = c+d
  ans_list = set(s)
else:
  ans_list = e
for num in ans_list:
  print(num)

### FIXED CODE ###

a,b,k = map(int,input().split())
if b+2 <= a+2*k:
  for i in range(a,b+1):
    print(i)
else:
  for i in range(a,a+k):
    print(i)
  for i in range(b+1-k,b+1):
    print(i)
import sys
N,K=map(int,input().split())
alist=list(map(int,input().split()))
#print(alist)

if K==0:
  print(max(alist))
  sys.exit(0)

memo={}
def isOK(x):
  if x in memo:
    return memo[x]
  
  num_cut=0
  for a in alist:
    num_cut+=-(-(a-x)//x)
    if num_cut>K:
      memo[x]=False
      return False  
    
  memo[x]=True
  return True

l=1
r=max(alist)
while l<=r:
  mid=(l+r)//2
  
  if not isOK(mid-1) and isOK(mid):
    print(mid)
    break
  elif isOK(mid-1):
    r=mid
  else:
    l=mid

### FIXED CODE ###

N,K=map(int,input().split())
alist=list(map(int,input().split()))
#print(alist)

def num_cut(x):
  if x==0:
    return float("inf")
  
  ret=0
  for a in alist:
    ret+=-(-(a-x)//x)
  return ret

#for i in range(1,max(alist)):
#  print(i,num_cut(i))

l=1
r=max(alist)+1
while l<=r:
  mid=(l+r)//2
  #print(l,mid,r)
  
  if num_cut(mid-1)>K and num_cut(mid)<=K:
    print(mid)
    break
  elif num_cut(mid)<=K:
    r=mid
  else:
    l=mid
n = int(input())
x = [int(input()) for _ in range(n)]
ans = list()
for p in x:
  v_sum = 0
  for i in x:
    v_sum += (p - x)**2
  	ans.append(v_sum)
print(ans.min())

### FIXED CODE ###

n = int(input())
x = list(map(int,input().split()))
ans = list()
for p in range(1,101):
  v_sum = 0
  for i in x:
    v_sum += (p - i)**2
  ans.append(v_sum)
print(min(ans))
import numpy as np
import fractions as fra


h,w=map(int,input().split())
if(h+w>=10):
    print("error"):
else:
    print(h+w)

### FIXED CODE ###


import numpy as np
import fractions as fra


h,w=map(int,input().split())
if(h+w>=10):
    print("error")
else:
    print(h+w)
N=int(input())
for a in range(N//4+1):
    for b in range(N//7+1):
        if 4*a+7*b==N:
            print(Yes)
        else:
            print(No)


### FIXED CODE ###

N=int(input())
for a in range(N//4+1):
    for b in range(N//7+1):
        if 4*a+7*b==N:
            print('Yes')
            exit()
  
print('No')
3 3
dxx
axx
cxx

### FIXED CODE ###

N, L = map(int, input().split())
S = ["" for i in range(N)]
for i in range(N):
    S[i] = input()

S.sort()
result = ""
for i in range(N):
    result += S[i]
print(result)
text = list(input())

def swap(char, a, b):
    if char == a:
        return(b)
    if char == b:
        return(a)

res = list(map(lambda x: swap(x, "1", "9"), text))
print("".join(res))
~                     

### FIXED CODE ###

text = list(input())

def swap(char, a, b):
    if char == a:
        return(b)
    if char == b:
        return(a)

res = list(map(lambda x: swap(x, "1", "9"), text))
print("".join(res))
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = [input() for _ in range(N)]

cnt_s = Counter(S)
tmp = cnt_s.most_common()[0][1]
for key, val in sorted(cnt_s.most_common(), lambda x:x[0]):
		if val == tmp:
      			print(key)

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = [input() for _ in range(N)]

cnt_s = Counter(S)
tmp = cnt_s.most_common()[0][1]
for key, val in sorted(cnt_s.most_common(), key=lambda x:x[0]):
		if val == tmp:
      			print(key)
n = int(input())
a = list(map(int,input().split()))

x = [a[1],a[0],a[1] % a[0]]
a.sort()
for i in range(1,n+1):
    while x[2] > 0:
        x[0] = x[1]
        x[1] = x[2]
        x[2] = x[0] % x[1]
    x[0] = a[i+1]
    x[2] = x[0] % x[1]

print(x[1])


### FIXED CODE ###

n,m = map(int,input().split())
ka = list(list(map(int,input().split())) for _ in range(n))

like = [0]*m
for i in range(n):
    for j in range(1,ka[i][0]+1):
        like[ka[i][j]-1] += 1

answer = 0
for i in range(m):
    if like[i] == n:
        answer += 1

print(answer)
import math

N = int(input())
A = list(map(lambda x: int(x)%(10**9+7), input().split()))

digit = math.floor(math.log2(max(A))) + 1
bin_A = [format(Ai, '0' + str(digit) + 'b') for Ai in A]

ans = 0

for i in range(digit):
    num0 = 0
    num1 = 0
    for j in range(N):
        if bin_A[j][i] == '1':
            num1 += 1
        else:
            num0 += 1
    ans += (num1 * num0) * (2**(digit-i-1))

print(ans % (10**9 + 7))

### FIXED CODE ###

import math

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

ans = 0
fil = 1
for i in range(60):
    num1 = len([1 for j in range(N) if A[j] & fil])
    num0 = N - num1
    ans += (num1 * num0) * fil
    fil <<= 1

print(ans % (10 ** 9 + 7))
import math
A, B = map(int, input().split())
gcd = math.gcd(A, B)
ans = 1
sqrt = math.sqrt(gcd)
for i in range(2, int(sqrt) + 2):
    if gcd % i == 0:
        ans += 1
        while True:
            gcd //= i
            if gcd % i != 0:
                break
if sqrt < gcd:
    ans += 1
print(ans)

### FIXED CODE ###

import fractions
A, B = map(int, input().split())
gcd = fractions.gcd(A, B)
ans = 1
sqrt = gcd ** 0.5
for i in range(2, int(sqrt) + 2):
    if gcd % i == 0:
        ans += 1
        while True:
            gcd //= i
            if gcd % i != 0:
                break
if sqrt < gcd:
    ans += 1
print(ans)
a=input().split()
b=input().split()
count=0
for i in range(3):
  if a[i]==b[i]:
    count+=1
print(count)
  

### FIXED CODE ###

a=input()
b=input()
count=0
for i in range(3):
  if a[i]==b[i]:
    count+=1
print(count)
x = int(input())
for i in range(1,10):
	for  j in range(1,10):
    	f = 0
    	if(i*j==x):
      		f = 1
      		print("Yes")
      		break
	if(f==1)
    break
 

if(f==0):
  print("No")

### FIXED CODE ###

x = int(input())
for i in range(1,10):
  for  j in range(1,10):
    f = 0
    if(i*j==x):
      	f = 1
      	print("Yes")
      	break
  if(f==1):
    break
  
if(f==0):
  print("No")
input()
a=sorted(map(int, input().split()))[::-1]
print(sum(a[::2]-sum(a[1::2]))

### FIXED CODE ###

input()
a=sorted(map(int, input().split()))[::-1]
print(sum(a[::2])-sum(a[1::2]))
N = int(input())
nums = list(map(int, input().split()))
nums.sort()

# 解説の通りに実装
num_max = nums[-1]
exist_counts = [0] * (num_max + 1)
for num in nums:
  # すでにcountされてる場合、重複であることだけ残して抜ける
  if exist_counts[num]:
    exist_counts[num] = 2
    continue
  # はじめてのcountであれば、自分自身とその倍数にチェックをつける
  idx = num
  while idx < num_max:
    exist_counts[idx] += 1
    idx += num

# 各numについて、count=1ならば条件を満たしたということ
count = 0
for num in nums:
  if exist_counts[num] == 1:
    count += 1
print(count)

### FIXED CODE ###

lst = list(map(int, input().split()))
print(lst.index(0) + 1)
import itertools
f = lambda n:sum(i for i in range(n+1))

def sol():
    res = 0
    while q:
        x0 = q.popleft()
        x1 = q.popleft()
        res += f(max(x0, x1)) + f(min(x0, x1) -1)
    return res

s = input().rstrip("\n")

q = collections.deque()
for k, g in itertools.groupby(s):
    q.append(len(list(g)))
if len(q) % 2:
    q.append(1)

print(sol())


### FIXED CODE ###

def main():
  s = input().rstrip('\n')
  n = len(s)
  dp = [0] * (1 + n)
  for i,c in enumerate(s):
    if c == '<':
      dp[i+1] = dp[i] + 1
  for i in range(n-1, -1, -1):
    if s[i] == '>':
      dp[i] = max(dp[i], dp[i+1] + 1)
  return sum(dp)

print(main())
I,*U=N,*D=9**9,
P,*L='x+y,',
M,*R='x-y,',
for t in[*open(n:=0)][1:]:*z,u=t.split();exec(u+'+=[*map(int,z)],')
for*A,S in(D,R,M+P),(D,U,'x,y,'),(L,R,'y,x,'),(U,R,P+M),(L,D,P+M),(L,U,M+P):
 for x,y,r in eval('sorted((%sQ)for Q,P in enumerate(A)for x,y in P)'%S):
  if r:n,p=x,y
  elif x==n:N=min(N,y-p)
print(N%I*5or'SAFE')

### FIXED CODE ###

d=[[],[],[],[]]
for t in[*open(0)][1:]:*z,u=t.split();d[ord(u)%5]+=[*map(int,z)],
I=N=9**9
P,M='x+y,','x-y,'
for*A,S in(3,0,'x,y,'),(1,2,'y,x,'),(0,2,P+M),(1,3,P+M),(1,0,M+P),(3,2,M+P):
 n=p=-I
 for x,y,r in eval('sorted((%sQ)for Q,P in enumerate(A)for x,y in d[P])'%S):
  if r:n,p=x,y
  elif x==n:N=min(N,y-p)
print(N%I*5or'SAFE')
# -*- coding: utf-8 -*-

A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500*i + 100*j + 50*k == X:
                ans += 1
print(ans)

### FIXED CODE ###

#-*- coding: utf-8 -*-
a = int(input())
b = int(input())
c = int(input())
print((a-b)%c)
n = int(input())
b = list(map(int, input().split()))
if n == 2:
    print(b[0] * 2)
    exit()

a = []
b.append(b[-1])
for i in range(n):
    a.append(min(b[i - 1], b[i]))
print(sum(a))    

### FIXED CODE ###

n, k = map(int, input().split())
s = input()

before = 0
score = 0
for i in range(n):
    if before == s[i]:
        score += 1
    before = s[i]

print(min(n - 1, score + k * 2))
def main():
    n, q = split_and_to_int(input().strip())
    s = input().strip()

    res = ""
    pos = []
    for i in range(len(s)):
        if s[i] == 'A' and s[i+1] == 'C':
            i += 1
            pos.append(i)

    for _ in range(q):
        le, re = split_and_to_int(input().strip())
        n = 0
        for v in pos:
            if le <= v < re:
                n += 1
            if re < v:
                break
        res = res + "\n" + str(n)

    print(res.strip())


def split_and_to_int(s):
    return [int(i) for i in s.split()]


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n, q = map(int, input().split())
    s = input()

    # 累積出現数を格納: 指定される番号が1始まりなのでズラして格納
    p = [0] * (n+1)
    for i in range(n):
        p[i+1] = p[i] + (1 if s[i:i+2] == "AC" else 0)

    for i in range(q):
        l, r = map(int, input().split())
        # 終端(=l-1)から始端-1(=r-1)の累積出現数を引いた数が指定区間内での出現回数
        print(p[r-1] - p[l-1])


if __name__ == '__main__':
    main()
n = input()

s = [input() for _ in range(n)]

print('AC x ', s.count('AC'))
print('WA x ', s.count('WA'))
print('TLE x ', s.count('TLE'))
print('RE x ', s.count('RE'))


### FIXED CODE ###

n = int(input())

s = [input() for _ in range(n)]

print('AC x ', s.count('AC'))
print('WA x ', s.count('WA'))
print('TLE x ', s.count('TLE'))
print('RE x ', s.count('RE'))
n,x=map(int,input().split())
l=[int(input()) for _ in range(n)]

ans=0
a=0
for i in range(n):
  if a<=x:
    a+=l[0]
    ans+=1
        
print(ans)

### FIXED CODE ###

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

ans=1
a=0
for i in range(n):
  a+=l[i]
  if a>x:
    break
  else:
    ans+=1
    
print(ans)
a,b = map(str,input().split()

if a == "H" and b == "H":
    print("H")
elif a == "H" and b == "D":
    print("D")
elif a == "D" and b == "H":
    print("D")
else: a == "D" and b == "D":
    print("H")

### FIXED CODE ###

#AtCoDeerくん
#a = 'H'のとき正直者
#a = 'D'のとき嘘つき
#AtCoDeerくん
#b = 'H'のとき、「TopCoDeerくんは正直者だ」と発言する
#b = 'D'のとき、「TopCoDeerくんは嘘つきだ」と発言する

#TopCoDeerくんが正直者かどうか判定してください。
#a = H b = H →H
#a = H b = D →D
#a = D b = H →D
#a = D b = D →H

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

if a == "H" and b == "H":
    print("H")
if a == "H" and b == "D":
    print("D")
if a == "D" and b == "H":
    print("D")
if a == "D" and b == "D":
    print("H")
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, K = MAP()
S = input()

if S[K - 1] == "A":
  S[K - 1] = "a"
if S[K - 1] == "B":
  S[K - 1] = "b"
if S[K - 1] == "C":
  S[K - 1] = "c"

print(S)

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
N, K = MAP()
S = input()
 
if S[K - 1] == "A":
  S = S[0:K - 1] + "a" + S[K:]
if S[K - 1] == "B":
  S = S[0:K - 1] + "b" + S[K:]
if S[K - 1] == "C":
  S = S[0:K - 1] + "c" + S[K:]

print(S)
from math import factorial
import sys

sys.setrecursionlimit(2000)
n, k = map(int, input().split())

memo = {}
def combination(n,k):
  if n / 2 < k:
    k = n - k
  if (n,k) in memo:
    return memo[(n,k)]
  elif n < k:
    return memo.setdefault((n,k), 0)
  elif k == 0:
    return memo.setdefault((n,k), 1)
  elif k == 1:
    return memo.setdefault((n,k), n)
  else:
  	return memo.setdefault((n,k), combination(n-1,k) + combination(n-1,k-1))

for i in range(1, k + 1):
  print(combination(n-k+1,i)*combination(k-1,i-1)%(10**9+7))


### FIXED CODE ###

from math import factorial
import sys

sys.setrecursionlimit(2000)
mod = 10**9+7
n, k = map(int, input().split())

memo = {}
def combination(n,k):
  if n < k:
    return 0
  return factorial(n)//factorial(k)//factorial(n-k)
  if n / 2 < k:
    k = n - k
  if n in memo and k in memo[n]:
    return memo[n][k]
  v = 0
  if k == 0:
    v = 1
  elif k == 1:
    v = n
  else:
    v = combination(n-1,k) + combination(n-1,k-1)
  return memo.setdefault(n, {}).setdefault(k, v)

for i in range(1, k + 1):
  print(combination(n-k+1,i)*combination(k-1,i-1)%mod)
h,w,n=[input() for i in range(3)]
n = int(n)
w = int(w)
h = int(h)
if(h >= w):
  temp = h
else:
  temp = w
temp = (n // temp)
if(n % temp != 0):
	temp = temp + 1
print(temp)


### FIXED CODE ###

h,w,n=[input() for i in range(3)]
n = int(n)
w = int(w)
h = int(h)
if(h >= w):
  temp = h
elif(w > h):
  temp = w
if(n % temp != 0):
  temp = (n // temp)
  temp = temp + 1
else:
  temp = (n // temp)
print(temp)
import networkx as nx
import sys

input = sys.stdin.buffer.readline

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

S = [list(input()) for _ in range(n)]
G = nx.DiGraph()

start = (n, n)
cnt = 0
goal = (n, n + 1)

for i in range(n):
    for j in range(n):
        if S[i][j] != "#":
            if S[i][j] == "o":
                cnt += 1
                G.add_edge(start, (i, j), capacity=1)
            if i + 1 < n:
                if S[i + 1][j] != "#":
                    G.add_edge((i, j), (i + 1, j), weight=-1)
            if j + 1 < n:
                if S[i][j + 1] != "#":
                    G.add_edge((i, j), (i, j + 1), weight=-1)
            G.add_edge((i, j), goal, capacity=1)
# G.add_node(start, demand=cnt)
# G.add_node(goal, demand=-cnt)
mincostflow = nx.max_flow_min_cost(G, start, goal)
ans = nx.cost_of_flow(G, mincostflow)
print(-ans)


### FIXED CODE ###

import networkx as nx

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

S = [list(input()) for _ in range(n)]
G = nx.DiGraph()

start = (n, m)
cnt = 0
goal = (n, m + 1)

for i in range(n):
    for j in range(m):
        if S[i][j] != "#":
            if S[i][j] == "o":
                cnt += 1
                G.add_edge(start, (i, j), capacity=1)
            if i + 1 < n:
                if S[i + 1][j] != "#":
                    G.add_edge((i, j), (i + 1, j), weight=-1)
            if j + 1 < m:
                if S[i][j + 1] != "#":
                    G.add_edge((i, j), (i, j + 1), weight=-1)
            G.add_edge((i, j), goal, capacity=1)
# G.add_node(start, demand=cnt)
# G.add_node(goal, demand=-cnt)
mincostflow = nx.max_flow_min_cost(G, start, goal)
ans = nx.cost_of_flow(G, mincostflow)
print(abs(ans))
A = input()
st = [(0, 0, -1)]
cur = 0; ma = 0
for i, a in enumerate(A):
    if a == '/':
        cur += 1
        s = 0
        while st and st[-1][0] == cur-1 and cur <= ma:
            lev, su, j = st.pop()
            s += su
        if st and st[-1][0] == cur:
            s += i - st[-1][2] - 1
        ma = max(ma, cur)
        st.append((cur, s, i))
    elif a == '\\':
        cur -= 1
        st.append((cur, 0, i))
    elif a == '_':
        st.append((cur, 0, i))
ans = []
for lev, su, j in st:
    if su > 0:
        and.append(su)
print(sum(ans))
print(len(ans), *ans)


### FIXED CODE ###

A = input()
st = [(0, 0, -1)]
cur = 0; ma = 0
for i, a in enumerate(A):
    if a == '/':
        cur += 1
        s = 0
        while st and st[-1][0] == cur-1 and cur <= ma:
            lev, su, j = st.pop()
            s += su
        if st and st[-1][0] == cur:
            s += i - st[-1][2] - 1
        ma = max(ma, cur)
        st.append((cur, s, i))
    elif a == '\\':
        cur -= 1
        st.append((cur, 0, i))
    elif a == '_':
        st.append((cur, 0, i))
ans = []
for lev, su, j in st:
    if su > 0:
        ans.append(su)
print(sum(ans))
print(len(ans), *ans)
#061-D
#v,Eは、頂点(vertex),辺(edge)の数
v,E=map(int,input().split())
e=[]
for i in range(E): #eの各要素は[始点,終点,コスト]
    f,t,c=map(int,input().split())
    e.append([f-1,t-1,-c])
d=[None for i in range(v)]
def lp(s,g): #sは始点、dに各頂点への最短距離が格納される
    for i in range(v):
        d[i]=float('INF')
    d[s]=0
    c=0
    while c<v+1:
        update=False
        for i in range(E):
            if d[e[i][0]]!=float('INF') and d[e[i][1]]>d[e[i][0]]+e[i][2]:
                d[e[i][1]]=d[e[i][0]]+e[i][2]
                update=True
        if update==False:
            break
        c+=1
    if c==v+1:
        print('inf')
    else:
        print(-d[g])
lp(0,2)

### FIXED CODE ###

#061-D
#v,Eは、頂点(vertex),辺(edge)の数
v,E=map(int,input().split())
e=[]
for i in range(E): #eの各要素は[始点,終点,コスト]
    f,t,c=map(int,input().split())
    e.append([f-1,t-1,c])
d=[None for i in range(v)]
for i in range(v):
    d[i]=-float('INF')
d[0]=0
for i in range(v-1):
    update=False
    for i in range(E):
        if d[e[i][0]]!=-float('INF') and d[e[i][1]]<d[e[i][0]]+e[i][2]:
            d[e[i][1]]=d[e[i][0]]+e[i][2]
            update=True
    if not update:
        break
ans=d[v-1]
for i in range(E):
    if d[e[i][0]]!=-float('INF') and d[e[i][1]]<d[e[i][0]]+e[i][2]:
        d[e[i][1]]=d[e[i][0]]+e[i][2]
print(ans if ans==d[v-1] else 'inf')
line = list(map(int,intput().split()))
line.sort()

print(line[0] + line[1])

### FIXED CODE ###

line = list(map(int,input().split()))
line.sort()

print(line[0] + line[1])
import sys
from collections import Counter
input = lambda: sys.stdin.readline().rstrip('\r\n')

# Disjoint Set Union

class DSU(object):

    def __init__(self, n):
        self.parent = [-1] * n

    def find(self, key):
        if self.parent[key] == -1:
            return key
        return self.find(self.parent[key])

    def union(self, a, b):
        s1, s2 = self.find(a), self.find(b)
        if s2 != s1:
            self.parent[s2] = s1

    def show(self):
        print(self.parent[1:])

def solve():
    n, m = map(int, input().split())
    d = DSU(n + 1)
    if m:
        for _ in range(m):
           a, b = map(int, input().split())
           d.union(a, b)
        ans = []
        for i in range(1, n + 1):
            ans.append(d.find(i))
        mp = Counter(ans)
        print(max(mp.values()))
    else:
        print(1)
    

solve()

### FIXED CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip('\r\n')

class DSU(object):
    
    def __init__(self, n):
        self.parent = [i for i in range(n)]
        self.rank = [1] * n
        self.cycle = False

    def find(self, key):
        if self.parent[key] != key:
            self.parent[key] = self.find(self.parent[key])
        return self.parent[key]

    def union(self, a, b):
        s1, s2 = self.find(a), self.find(b)
        if s1 != s2:
            if self.rank[s1] < self.rank[s2]:
                self.parent[s1] = s2
                self.rank[s2] += self.rank[s1]
            else:
                self.parent[s2] = s1
                self.rank[s1] += self.rank[s2]
        else:
            self.cycle = True
        
    def has_cycle(self):
        return self.cycle
    
    def show_parent(self):
        return self.parent

    def show_rank(self):
        return self.rank

def solve():
    n, m = map(int, input().split())
    d = DSU(n + 1)
    if m > 0:
        for _ in range(m):
            a, b = map(int, input().split())
            d.union(a, b)
        # print(d.show_parent())
        print(max(d.show_rank()))
    else:
        print(1)

solve()
n = input()

print(n.translate(str.maketrans({"1":"9", "9":"1"}))

### FIXED CODE ###

n = input()

print(n.translate(str.maketrans({"1":"9", "9":"1"})))