Harryxun/stf_run huggingface dataset:
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.root = [-1]*n
    self.rank = [0]*n
    
  def find_root(self, e):
    if self.root[e] < 0:
      return e
    else:
      r = self.find_root(self.root[e])
      self.root[e] = r
      return r
    
  def combine(self, e1, e2):
    root1 = self.find_root(e1)
    root2 = self.find_root(e2)
    if root1 == root2:
      pass
    elif self.rank[root1] < self.rank[root2]:
      self.root[root1] += self.root[root2]
      self.root[root2] = root1
      self.rank[root1] = self.rank[root2] + 1
    elif self.rank[root2] < self.rank[root1]:
      self.root[root2] += self.root[root1]
      self.root[root1] = root2
      self.rank[root2] = self.rank[root1] + 1
    else:
      self.root[root2] += self.root[root1]
      self.root[root1] = root2
      self.rank[root2] += 1
      
  def in_the_same_group(self, e1, e2):
      r1 = self.find_root(e1)
      r2 = self.find_root(e2)
      if r1 == r2:
        return True
      return False
  

NMK = input().split()
N = int(NMK[0])
M = int(NMK[1])
K = int(NMK[2])
uf = UnionFind(N)
from collections import defaultdict

friend_list = defaultdict(list)
for _ in range(M):
  AB = input().split()
  A = int(AB[0])-1
  B = int(AB[1])-1
  uf.combine(A,B)
  friend_list[A].append(B)
  friend_list[B].append(A)

block_list = defaultdict(list)
for _ in range(K):
  CD = input().split()
  C = int(CD[0])-1
  D = int(CD[1])-1
  if uf.in_the_same_group(C, D):
    block_list[C].append(D)
    block_list[D].append(C)

cnt = defaultdict(int)
ans = []
for i in range(N):
  cnt[i] = -uf.root[uf.find_root(i)] - 1 - len(friend_list[i]) - len(block_list[i])
  ans.append(str(cnt[i]))

print(" ".join(ans))

### FIXED CODE ###

class UnionFind():
 def __init__(self,n):
   self.n=n
   self.root=[-1]*(n+1)
   self.rank=[0]*(n+1)
 def FindRoot(self,x):
   if self.root[x]<0:
     return x
   else:
     self.root[x]=self.FindRoot(self.root[x])
     return self.root[x]
 def Unite(self,x,y):
   x=self.FindRoot(x)
   y=self.FindRoot(y)
   if x==y:
     return
   else:
     if self.rank[x]>self.rank[y]:
       self.root[x]+=self.root[y]
       self.root[y]=x
     elif self.rank[x]<=self.rank[y]:
       self.root[y]+=self.root[x]
       self.root[x]=y
       if self.rank[x]==self.rank[y]:
         self.rank[y]+=1
 def isSameGroup(self,x,y):
   return self.FindRoot(x)==self.FindRoot(y)
 def Count(self,x):
   return -self.root[self.FindRoot(x)]
 
n,m,k=map(int,input().split())
t=UnionFind(n+1)
cnt=[0]*(n+1) #各iについて、iと同一の連結成分に属する友達関係の人、ブロック関係の人の数を数える
for _ in range(m):
 a,b=map(int,input().split())
 cnt[a]+=1 #各iについて、iと同一の連結成分に属する友達関係の人の数を数える
 cnt[b]+=1
 t.Unite(a,b)
for _ in range(k):
 a,b=map(int,input().split())
 if t.isSameGroup(a,b)==True:
   cnt[a]+=1 #各iについて、iと同一の連結成分に属するブロック関係の人の数を数える
   cnt[b]+=1
ans=[0]*(n+1)
for i in range(1,n+1):
 ans[i]=(t.Count(i)-1)-cnt[i] #答えは(各iが属する連結成分のサイズ)-1-((iと同一の連結成分に含まれているiと友達関係にある人の数)+(iと同一の連結成分に含まれているiとブロック関係にある人の数)となる
print(*ans[1:])
S = input()
flag = False
if S[0] == "A":
    count = 0
    for i,j in enumerate(S[2:-1]):
        if j == "C":
            count+=1
            ind = i+2
    if count == 1:
        tmp = S[1:ind]+A[ind+1:]
        if tmp == tmp.lower():
            flag = True
            
if flag:
    print("AC")
else:
    print("WA")

### FIXED CODE ###

S = input()
flag = False
if S[0] == "A":
    count = 0
    for i,j in enumerate(S[2:-1]):
        if j == "C":
            count+=1
            ind = i+2
    if count == 1:
        tmp = S[1:ind]+S[ind+1:]
        if tmp == tmp.lower():
            flag = True
            
if flag:
    print("AC")
else:
    print("WA")
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
A=[list(map(int,input().split())) for i in range(M)]

B=[0]*N
# from functools import lru_cache
# @lru_cache(maxsize=1000)
# def yapoos()
for i in A:
    if H[i[0]]>H[i[1]]:
        B[i[0]]=1
    elif H[i[0]]<H[i[1]]:
        B[i[1]]=1
print(B.count(0))

### FIXED CODE ###

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

B=[0]*N
# from functools import lru_cache
# @lru_cache(maxsize=1000)
# def yapoos()
for i in A:
    if H[i[0]-1]>H[i[1]-1]:
        B[i[1]-1]=1
    elif H[i[0]-1]<H[i[1]-1]:
        B[i[0]-1]=1
    else:
        B[i[0]-1]=1
        B[i[1]-1]=1
print(B.count(0))
n,m = map(int,input().split())
mat = [0 for i in range(n+1)]

for i in range(m):
    mat[int(input())] = -1

for i in range(n):
    if i == 0:
        mat[i] = 1
    if mat[i] == -1:
        continue
    if i + 1 < n+1:
        if mat[i+1] != -1:
            mat[i+1] += mat[i]
    if i + 2 < n+1:
        if mat[i+2] != -1:
            mat[i+2] += mat[i]
    print(mat)
if mat[-1] => 0:
    print(mat[-1]%1000000007)
else:
    print(0)
 

### FIXED CODE ###

n,m = map(int,input().split())
mat = [0 for i in range(n+1)]

for i in range(m):
    mat[int(input())] = -1

for i in range(n):
    if i == 0:
        mat[i] = 1
    if mat[i] == -1:
        continue
    if i + 1 < n+1:
        if mat[i+1] != -1:
            mat[i+1] += mat[i]
    if i + 2 < n+1:
        if mat[i+2] != -1:
            mat[i+2] += mat[i]
if mat[-1] >= 0:
    print(mat[-1]%1000000007)
else:
    print(0)
def solve():
    rec = list(range(1000000))
    odd_rec = rec.copy()
    
    for i in range(2, 181):
        t = i * (i + 1) * (i + 2) // 6
        if t % 2 == 0:
            for i, tpl in enumerate(zip(rec[t:], rec), start=t):
                a, b = tpl
                b += 1
                if a < b:
                    rec[i] = a
                else:
                    rec[i] = b
        else:
            z_rec = zip(rec[t:], rec, odd_rec[t:], odd_rec)
            for i, tpl in enumerate(z_rec, start=t):
                a, b, c, d = tpl
                b += 1
                if a < b:
                    rec[i] = a
                else:
                    rec[i] = b
                d += 1
                if c < d:
                    odd_rec[i] = c
                else:
                    odd_rec[i] = d
    
    import sys
    file_input = sys.stdin
    n = int(file_input.readline())
    while n:
        print(rec[n], odd_rec[n])
        n = int(file_input.readline())

solve()


### FIXED CODE ###

def solve():
    rec = [1000000] * 1000000
    rec[0] = 0
    odd_rec = rec.copy()
    
    for i in range(1, 181):
        t = i * (i + 1) * (i + 2) // 6
        for i, tpl in enumerate(zip(rec[t:t*3+1], rec), start=t):
            a, b = tpl
            b += 1
            if b < a:
                rec[i] = b
        if t % 2:
            for i, tpl in enumerate(zip(odd_rec[t:t*34+1], odd_rec), start=t):
                a, b = tpl
                b += 1
                if b < a:
                    odd_rec[i] = b
    
    import sys
    file_input = sys.stdin
    n = int(file_input.readline())
    while n:
        print(rec[n], odd_rec[n])
        n = int(file_input.readline())

solve()
s, t = map(int, input().split())
a = t-s
print(1+int(a/(s-1))

### FIXED CODE ###

from math import ceil

s, t = map(int, input().split())
a = t-s
print(1+ceil(a/(s-1)))
n,m=map(int,input().split())
arr=list(map(int,input().split())
 arr.sort()
print(sum(arr[:m]))

### FIXED CODE ###

n,m=map(int,input().split())
arr=sorted(list(map(int,input().split())))
print(sum(arr[:m]))
N,K = map(int,input().split())
A = list(map(int,input().split()))
A_dict = {i:a for i,a in enumerate(A,1)}

History = [1]
History_set = {1}
now = 1
for _ in range(N):
    now = A_dict[now]
    if now not in History_set:
        History.append(now)
        History_set.add(now)
    else:
        break
#print(History,now)
if K <= N:
    print(History[K])
else:
    e = History.index(now)
    #print(e)
    #print(History[e:])
    loop_num = len(History[e:])
    #print(loop_num)
    num = (K-e)%loop_num
    #print(num)
    print(History[e:][num])

### FIXED CODE ###

N,K = map(int,input().split())
A = list(map(int,input().split()))
A_dict = {i:a for i,a in enumerate(A,1)}

History = [1]
History_set = {1}
now = 1
for i in range(N):
    now = A_dict[now]
    if now not in History_set:
        History.append(now)
        History_set.add(now)
    else:
        break
#print(History,now)
if K < i:
    print(History[K])
else:
    e = History.index(now)
    #print(e)
    #print(History[e:])
    loop_num = len(History[e:])
    #print(loop_num)
    num = (K-e)%loop_num
    #print(num)
    print(History[e:][num])
import math
n=int(input())
a=[]
y=math.log(((n*25)/26)+1,26)
#print(y)
if(y%1==0):
    print('z'*int(y))
else:
  y=math.ceil(y)
  for i in range(y):
    a.append(n%(26**(i+1)))
#print(a)
  for i in range(y):
       a[i]=a[i]//(26**(i))
  a.reverse()
#print(a,y)
  q=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']    
  for i in range(y+1):
    print(q[a[i]-1],end="")

### FIXED CODE ###

n=int(input())
s='zabcdefghijklmnopqrstuvwxy'
a=''
while(int(n)>0):
        t=n%26
        if t==0:
            n-=26
        a=s[t]+a
        n=n//26
print(a)
n=input()
l=len(n)
s=0
for i in range(l):
  s+=int(n[i])
if n%s==0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n=input()
l=len(n)
s=0
for i in range(l):
  s+=int(n[i])
if int(n)%s==0:
  print("Yes")
else:
  print("No")
import math

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

M = max(A)
ans = 1

G = math.gcd(A[0], A[1])
for i in range(2, N):
  G = math.gcd(G, A[i])

for i in reversed(range(G, M+1, G)):
  l = 0
  for j in range(N):
    if A[j] % i > 0:
      l += 1
  
  if l <= 1:
    ans = i
    break

print(ans)

### FIXED CODE ###


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


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

if N == 2:
  print(max(A))
else:

  L = [0 for j in range(N+1)]
  R = [0 for j in range(N+1)]
  
  for j in range(N):
    L[j+1] = gcd(L[j], A[j])
  for j in reversed(range(N)):
    R[j] = gcd(R[j+1], A[j])

    m = -1
  for j in range(N):
    m = max(m, gcd(L[j], R[j+1]))
  print(m)
import math

a, b = map(int, input().split())  # 複数数値入力

A = list()
B = list()

for i in range(1, int(math.log2(b))+2):
    tmp = b // (2 ** i) * 2 ** (i - 1)

    if b % (2 ** i) < (2 ** (i-1)):
        plus = 0
    else:
        plus = b % (2 ** i) - 2 ** (i-1) + 1

    B.append(tmp+plus)
if a == 0:
    A = [0]
elif a == 1:
    A = [1]
else:
    for i in range(1, int(math.log2(a-1))+2):
        tmp = (a-1) // (2 ** i) * 2 ** (i - 1)

        if (a-1) % (2 ** i) < (2 ** (i-1)):
            plus = 0
        else:
            plus = (a-1) % (2 ** i) - 2 ** (i-1) + 1

        A.append(tmp + plus)

ans = 0
for i in range(0, int(math.log2(b)) + 1):
    if i >= len(A):
        ans += (B[i]) % 2 * 10 ** i
    else:
        ans += (B[i] - A[i]) % 2 * 10 ** i

print(int(str(ans), 2))


### FIXED CODE ###

import math

a, b = map(int, input().split())  # 複数数値入力

A = list()
B = list()

if b == 0:
    B = [0]
elif b == 1:
    B = [1]
else:
    for i in range(1, int(math.log2(b))+2):
        tmp = b // (2 ** i) * 2 ** (i - 1)

        if b % (2 ** i) < (2 ** (i-1)):
            plus = 0
        else:
            plus = b % (2 ** i) - 2 ** (i-1) + 1

        B.append(tmp + plus)

if a == 0:
    A = [0]
elif a == 1:
    A = [0]
else:
    for i in range(1, int(math.log2(a-1))+2):
        tmp = (a-1) // (2 ** i) * 2 ** (i - 1)

        if (a-1) % (2 ** i) < (2 ** (i-1)):
            plus = 0
        else:
            plus = (a-1) % (2 ** i) - 2 ** (i-1) + 1

        A.append(tmp + plus)

if b == 0:
    print(0)
else:
    ans = 0
    for i in range(0, int(math.log2(b)) + 1):
        if i >= len(A):
            ans += (B[i]) % 2 * 10 ** i
        else:
            ans += (B[i] - A[i]) % 2 * 10 ** i

    print(int(str(ans), 2))
a, b = map(int(input()).split())
seki = a * b
sekito = seki % 2
if sekito == 1:
  response = "Odd"
else :
  response = "Even"
print(response)

### FIXED CODE ###

a, b = map(int, input().split())
seki = a * b
sekito = seki % 2
if sekito == 1:
  response = 'Odd'
else :
  response = 'Even'
print(response)
import math
dish = []
for i in range(5):
    d = input()
    dish.append(d)
for j in dish:
    if j[-1] != '0':
        mini = j
for k in dish:
    if (k[-1] <= mini[-1]) and k[-1] != '0':
        mini = k
for i in range(5):
    if dish[i] == mini:
        dish.pop(i)
        break
time = 0
for l in range(4):
    dish[l] = math.ceil((int(dish[l]) / 10)) * 10
    time += int(dish[l])
time += int(mini)
print(time)


### FIXED CODE ###

import math
dish = []
mini = 0
for i in range(5):
    d = input()
    dish.append(d)
for j in dish:
    if j[-1] != '0':
        mini = j
if mini == 0:
    mini = dish[0]
for k in dish:
    if (k[-1] <= mini[-1]) and k[-1] != '0':
        mini = k
for i in range(5):
    if dish[i] == mini:
        dish.pop(i)
        break
time = 0
for l in range(4):
    dish[l] = math.ceil((int(dish[l]) / 10)) * 10
    time += int(dish[l])
time += int(mini)
print(time)
k=int(input())
mal=1      
n=list(map(int,input().split()))
      
          
for i in range(0,len(n)):
    if(n[i]==0):
        mal=0
        break
    mal=mal*n[i]
        if(mal>10**18):
            mal=-1
            break
print(mal)

        
           


### FIXED CODE ###

k=int(input())
mal=1      
n=list(map(int,input().split()))
      
          
for i in range(0,len(n)):
    mal=mal*n[i]
    if(mal>10**18):
            mal=-1
            break
for j in range(0,len(n)):
    if(n[j]==0):
        mal=0
print(mal)
s = input()
if s == "A":
    print("T")
elif: s == "T":
    print("A")
elif s == "C":
    print("G")
else:
    print("C")


### FIXED CODE ###

s = input()
if s == "A":
    print("T")
elif s == "T":
    print("A")
elif s == "C":
    print("G")
else:
    print("C")
x,y,a,b,c = map(int,input().split())

p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

red = []
green = []

# for i in range(x):
#     red.append(p[i])
# for j in range(y):
#     green.append(q[j])

# print(p[:x])
# print(q[:y]
# print(red)
# print(green)

all = p[:x] + q[:y]
all.sort()

for i in range(len(all)):
    if min(r) > all[i]:
        #print(i)
    if i >= len(r):
        ans = all[len(r) + 1:] + r
    else:
        ans = all[i + 1:] + r[:i]
    break

# for mushoku in r:
#     for i in range(len(all)):
#         if mushoku > all[i]:
#             all[i] = mushoku


# print(sum(all))
print(sum(ans))

### FIXED CODE ###

x,y,a,b,c = map(int,input().split())

p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort()


all = p[:x] + q[:y] + r
all.sort(reverse=True)

print(sum(all[:x+y]))
S = list(input())
if 'C' in S[2:-1]:
    Cj = True
else:
    Cj = False

if S[0] == 'A':
    Aj = True
else:
    Aj = false

Supper = [s for s in S if s.isupper()]
if Supper == ['A','C']:
    SupperJ = True
else:
    SupperJ = False

if(Cj and Aj and SupperJ):
        print("AC")
else:
    print("WA")

### FIXED CODE ###

S = input()
count = 0
if( S[0] == 'A' and S[2:-1].count('C') == 1):
    for i in range(len(S)):
        if S[i].isupper():
            count += 1
            if count == 3:
                print("WA")
                exit()
    print("AC")
else:
    print("WA")
import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
from scipy.spatial import distance


def main():
    N = int(input())
    xy = [list(map(int,input().split())) for i in range(N)]

    xy = np.array(xy)

    md = distance.cdist(xy, xy, metric='minkowski', p=1)


    print(0)



main()


### FIXED CODE ###

import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    N = int(input())
    xy = [list(map(int,input().split())) for i in range(N)]

    z_max = 0
    z_min = 2 * 10 **9

    w_max = - 10 ** 9
    w_min = 10 ** 9

    for i in range(N):
        z = xy[i][0] + xy[i][1]
        w = xy[i][0] - xy[i][1]
        z_max = max(z_max,z)
        z_min = min(z_min,z)
        w_max = max(w_max,w)
        w_min = min(w_min,w)

    res = max(z_max-z_min,w_max-w_min)

    print(res)



main()
a, b, c = map(input().split())
if a[-1] == b[0] and b[-1] == c[0]:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

a, b, c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
    print('YES')
else:
    print('NO')
def main
a, b = map(int,input().split())

print( a* b)
return

main()

### FIXED CODE ###

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

print(a*b)
def main():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    ans = 0
    if a[0] != a[1]:
        ans += 1

    for i in range(1, n):
        flg = True
        if i != n - 1:
            if a[i] == a[i - 1] or a[i] == a[i + 1] or a[i] < a[i-1]*2:
                continue
        else:
            if a[i] == a[i - 1] or a[i] < a[i-1]*2:
                continue

        for j in range(i):
            if a[i] % a[j] == 0:
                flg = False
                break
            if a[j] * 2 > a[i]:
                break
        if flg:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int, input().split()))

c = Counter(a)
b = [k for k, v in c.items() if v == 1]
b.sort()
d = {b: i for i, b in enumerate(b)}

gg = [True] * len(b)
mx = 10 ** 6 + 1
for i in c.keys():
    for j in range(2 * i, mx, i):
        if j in d:
            gg[d[j]] = False

print(sum(gg))
N,M=map(int, input().split())
H=list(map(int,input().split()))
List=[list(map(int,input().split())) for i in range(M)]
ans=0
alllist=[[0 for i in range(N)]for j in range(N)]

for j in range(M):
    alllist[List[j][0]-1][List[j][1]-1]=1
    alllist[List[j][1]-1][List[j][0]-1]=1


for s in range(M):
    flag=True
    for t in range(M):
        if H[s]<alllist[s][t]*H[t]:
            flag=False
            break
    if flag:
        ans=ans+1

print(ans)  

### FIXED CODE ###

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

sup_list=[1 for i in range(N)]

for j in range(M):
    if H[List[j][0]-1]>H[List[j][1]-1]:
        sup_list[List[j][1]-1]=0
    elif H[List[j][0]-1]==H[List[j][1]-1]:
        sup_list[List[j][0]-1]=0
        sup_list[List[j][1]-1]=0
    else:
        sup_list[List[j][0]-1]=0


print(sum(sup_list))
# LCS: Longest common subsequence
# dp[i][j]: Sのi-1番目まで, Tのj-1番目まででの最長共通文字列
# dp[0][0] = 0 長さ0の文字列
# dp[0][1] = 0 長さ1の文字列と長さ0の文字列
# dp[1][0] = 0 長さ0の文字列と長さ1の文字列
# dp[i][j] = max(dp[i-1][j], dp[i][j-1]) (S[i] != T[j])
# dp[i][j] = max(
#                dp[i-1][j-1]+1  (共通文字列を利用する),
#                dp[i-1][j]        (共通文字列を利用しない),
#                dp[i][j-1]        (共通文字列を利用しない),
#            )


dp = [[0 for _ in range(3001)] for _ in range(3001)]


def main():
    S = input()
    T = input()

    result = solve(S, T)
    print(result)


def solve(S, T):
    for i in range(1, len(S) + 1):
        for j in range(1, len(T) + 1):
            if S[i - 1] != T[j - 1]:
                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1], dp[i-1][j-1])
            else:
                dp[i][j] = max(dp[i - 1][j - 1] + 1, dp[i - 1][j], dp[i][j - 1])
    result = ""
    i = len(S)
    j = len(T)
    while dp[i][j] != 0:
        if dp[i][j] == dp[i-1][j]:
            i -= 1
        elif dp[i][j] == dp[i][j-1]:
            j -= 1
        else:
            result += S[i]
            i -= 1
            j -= 1
    return "".join(reversed(result))


if __name__ == "__main__":
    main()


### FIXED CODE ###

# LCS: Longest common subsequence
# dp[i][j]: Sのi-1番目まで, Tのj-1番目まででの最長共通文字列
# dp[0][0] = 0 長さ0の文字列
# dp[0][1] = 0 長さ1の文字列と長さ0の文字列
# dp[1][0] = 0 長さ0の文字列と長さ1の文字列
# dp[i][j] = max(dp[i-1][j], dp[i][j-1]) (S[i] != T[j])
# dp[i][j] = max(
#                dp[i-1][j-1]+1  (共通文字列を利用する),
#                dp[i-1][j]        (共通文字列を利用しない),
#                dp[i][j-1]        (共通文字列を利用しない),
#            )


dp = [[0 for _ in range(3001)] for _ in range(3001)]


def main():
    S = input()
    T = input()

    result = solve(S, T)
    print(result)


def solve(S, T):
    for i in range(1, len(S) + 1):
        for j in range(1, len(T) + 1):
            if S[i - 1] != T[j - 1]:
                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1], dp[i-1][j-1])
            else:
                dp[i][j] = max(dp[i - 1][j - 1] + 1, dp[i - 1][j], dp[i][j - 1])
    result = ""
    i = len(S)
    j = len(T)
    while dp[i][j] != 0:
        if dp[i][j] == dp[i-1][j]:
            i -= 1
        elif dp[i][j] == dp[i][j-1]:
            j -= 1
        else:
            result += S[i-1]
            i -= 1
            j -= 1
    return "".join(reversed(result))


if __name__ == "__main__":
    main()
n = int(input())
a_ = [[int(i) for i in input()] for j in range(n)]
a = set([_[0][0] for _ in a_])
print(len(a))

### FIXED CODE ###

#8th
n = int(input())
a = set(float(input()) for i in range(n))
# a_ = [[int(i) for i in input()] for j in range(n)]
# a = set(_[0] for _ in a_)
print(len(a))
from collections import deque
H, W, K = map(int, input().split())
m = [input() for i in range(H)]
v = [[0]*W for i in range(H)]
f = 0
for i in range(H):
	if f:
		break
	for j in range(W):
		if m[i][j] == "S":
			x = i
			y = j
			f = 1
			break
dq = deque([[x,y,0]])
v[x][y] = 1
ans = (min(x, y, H-1-x, W-1-y)+K-1)//K
while dq:
	x, y, c = dq.popleft()
	v[x][y] = 1
	ans = (ans, min(x, y, H-1-x, W-1-y)+K-1)//K
	if c < K:
		c += 1
		if x > 0 and m[x-1][y] == "." and not v[x-1][y]:
			dq.append([x-1,y,c])
		if x < H-1 and m[x+1][y] == "." and not v[x+1][y]:
			dq.append([x+1,y,c])
		if y > 0 and m[x][y-1] == "." and not v[x][y-1]:
			dq.append([x,y-1,c])
		if y < W-1 and m[x][y+1] == "." and not v[x][y+1]:
			dq.append([x,y+1,c])
print(ans+1)

### FIXED CODE ###

from collections import deque
H, W, K = map(int, input().split())
m = [input() for i in range(H)]
v = [[0]*W for i in range(H)]
f = 0
for i in range(H):
	if f:
		break
	for j in range(W):
		if m[i][j] == "S":
			x = i
			y = j
			f = 1
			break
dq = deque([[x,y,0]])
v[x][y] = 1
ans = (min(x, y, H-1-x, W-1-y)+K-1)//K
while dq:
	x, y, c = dq.popleft()
	ans = min(ans, (min(x, y, H-1-x, W-1-y)+K-1)//K)
	if c < K:
		c += 1
		if x > 0 and m[x-1][y] == "." and not v[x-1][y]:
			dq.append([x-1,y,c])
			v[x-1][y] = 1
		if x < H-1 and m[x+1][y] == "." and not v[x+1][y]:
			dq.append([x+1,y,c])
			v[x+1][y] = 1
		if y > 0 and m[x][y-1] == "." and not v[x][y-1]:
			dq.append([x,y-1,c])
			v[x][y-1] = 1
		if y < W-1 and m[x][y+1] == "." and not v[x][y+1]:
			dq.append([x,y+1,c])
			v[x][y+1] = 1
print(ans+1)
A=int(input())
B=int(input())
if(A>0 && B%A==0):
  print(B+A)
else:
  print(B-A)
  

### FIXED CODE ###

A,B=map(int,input().split())
if(A>0 and B%A==0):
  print(B+A)
else:
  print(B-A)
x = int(input())
ans = 0
a = 100
While a < x:
  a = a**1.01
  ans += 1  
print(ans)


### FIXED CODE ###

X = int(input())
y = 100
ans = 0
while True:
  ans += 1
  y += y//100
  if X <= y:
    break
print(ans)