Harryxun/stf_run huggingface dataset:
n = input()
 
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
 
for i in range(0, n):
   m, n = raw_input().split()
      if m == 'S':
         S[int(n)-1] = 0
      elif m == 'H':
         H[int(n)-1] = 0
      elif m == 'C':
         C[int(n)-1] = 0
      elif m == 'D':
         D[int(n)-1] = 0

for i in range(0, 13):
   if S[i] != 0:
      print 'S '+str(S[i])

for i in range(0, 13):
   if H[i] != 0:
      print 'H '+str(H[i])

for i in range(0, 13):
   if C[i] != 0:
      print 'C '+str(C[i])

for i in range(0, 13):
   if D[i] != 0:
      print 'D '+str(D[i])

### FIXED CODE ###

n=input()
  
s=range(1,14)
h=range(1,14)
c=range(1,14)
d=range(1,14)
   
for i in range(n):
   m, k=raw_input().split()
   if m == 'S':
      s[int(k)-1] = 0
   elif m == 'H':
      h[int(k)-1] = 0
   elif m == 'C':
      c[int(k)-1] = 0
   elif m == 'D':
      d[int(k)-1] = 0
  
for i in range(0, 13):
   if s[i] != 0:
      print 'S '+str(s[i])
  
for i in range(0, 13):
   if h[i] != 0:
      print 'H '+str(h[i])
  
for i in range(0, 13):
   if c[i] != 0:
      print 'C '+str(c[i])
  
for i in range(0, 13):
   if d[i] != 0:
      print 'D '+str(d[i])
from collections import deque
a=int(input())
list=deque([])

for i in range(a):
    order=input().split()
    if order[0]=="insert":
        list.appendleft(order[1])
    elif order[0]=="delete":
        if order[1] in list:
            list.remove(order[1])
    elif order[0]=="deleteFirst":
        list.pop(0)
    elif order[0]=="deleteLast":
        list.pop(len(list)-1)

print(*list)


### FIXED CODE ###

from collections import deque
a=int(input())
list=deque([])

for i in range(a):
    order=input().split()
    if order[0]=="insert":
        list.appendleft(order[1])
    elif order[0]=="delete":
        if order[1] in list:
            list.remove(order[1])
    elif order[0]=="deleteFirst":
        list.popleft()
    elif order[0]=="deleteLast":
        list.pop()

print(*list)
n = int(input())
lis = []
for i in range(n):
    lis.append(int(input()))

lis.sort()

mid = lis[n-1]
front, back = [], []
flag = 1
for i in range((n-1)//2):
    if flag:
        front.append(lis[i])
        back.append(lis[i + 1])
        flag = 0
    else:
        front.append(lis[n - i - 1])
        back.append(lis[n - i - 2])
        flag = 1
if (n-1) % 2 == 1:
    front.append(lis[n//2-1])
ans_M = mid - front[0] + mid - back[0]
for i in range(1, len(front)):
    ans_M += abs(front[i] - front[i-1])
for i in range(1, len(back)):
    ans_M += abs(back[i] - back[i-1])

mid = lis[0]
front, back = [], []
flag = 1
for i in range((n-1)//2):
    if flag:
        front.append(lis[n - i - 1])
        back.append(lis[n - i - 2])
        flag = 0
    else:
        front.append(lis[i])
        back.append(lis[i + 1])
        flag = 1
if (n-1) % 2 == 1:
    front.append(lis[n//2-1])
ans_m = front[0] - mid + back[0] - mid
for i in range(1, len(front)):
    ans_m += abs(front[i] - front[i-1])
for i in range(1, len(back)):
    ans_m += abs(back[i] - back[i-1])

print(max(ans_M, ans_m))

### FIXED CODE ###

n = int(input())
lis = []
for i in range(n):
    lis.append(int(input()))

lis.sort()

mid = lis[n-1]
front, back = [], []
flag = 1
for i in range((n-1)//2):
    if flag:
        front.append(lis[i])
        back.append(lis[i + 1])
        flag = 0
    else:
        front.append(lis[n - i - 1])
        back.append(lis[n - i - 2])
        flag = 1
if (n-1) % 2 == 1:
    front.append(lis[n//2-1])

if n == 2:
    ans_M = mid - front[0]
else:
    ans_M = mid - front[0] + mid - back[0]

for i in range(1, len(front)):
    ans_M += abs(front[i] - front[i-1])
for i in range(1, len(back)):
    ans_M += abs(back[i] - back[i-1])

mid = lis[0]
front, back = [], []
flag = 1
for i in range((n-1)//2):
    if flag:
        front.append(lis[n - i - 1])
        back.append(lis[n - i - 2])
        flag = 0
    else:
        front.append(lis[i])
        back.append(lis[i + 1])
        flag = 1
if (n-1) % 2 == 1:
    front.append(lis[n//2-1])

if n == 2:
    ans_m = front[0] - mid
else:
    ans_m = front[0] - mid + back[0] - mid

for i in range(1, len(front)):
    ans_m += abs(front[i] - front[i-1])
for i in range(1, len(back)):
    ans_m += abs(back[i] - back[i-1])

print(max(ans_M, ans_m))
class BIT():
    def __init__(self, size):
        self.table = [0 for _ in range(size + 2)]
        self.size = size 
    def Sum(self, i):
        s = 0
        while i>0:
            s+= self.table[i]
            i-=(i&-i)
        return s 

    def Add(self,i,x):
        while i<= self.size:
            self.table[i]+=x 
            i+=(i&-i) 
        return

n=int(input())
s=[input().split() for _ in range(2*n)]
costb = [[0 for _ in range(n+1)] for _ in range(n+1)]
costw = [[0 for _ in range(n+1)] for _ in range(n+1)]
bitb, bitw = BIT(n), BIT(n)
for i in range(2*n-1,-1,-1):
    c,x=s[i][0], int(s[i][1])
    if c=="B":
        base=bitb.Sum(x-1)
        for j in range(n+1):
            costb[x-1][j]= base+bitw.Sum(j)
        bitb.Add(x,1)
    else:
        base=bitw.Sum(x-1)
        for j in range(n+1):
            cost[j][x-1]=base+bitb.Sum(j)
        bitw.Add(x,1)

dp=[[0 for _ in range(n+1)] for _ in range(n+1)]
for i in range(n+1):
    for j in range(n+1):
        if i+j==0:
            continue
        if i==0:
            dp[i][j]=dp[i][j-1]+costw[i][j-1]
        elif j==0:
            dp[i][j]=dp[i-1][j]+costb[i-1][j]
        else:
            dp[i][j]=min(dp[i][j-1]+costw[i][j-1], dp[i-1][j]+costb[i-1][j])

print(dp[n][n])

### FIXED CODE ###

N=int(input())
Ball=[]
for i in range(2*N):
  c,a=input().split()
  Ball.append((c,int(a)))
B=[0]*N
W=[0]*N
B_table=[[0]*(N+1) for i in range(N)]
W_table=[[0]*(N+1) for i in range(N)]
for i in range(2*N):
  c=Ball[i][1]-1
  if Ball[i][0]=="B":
    B[c]=i+1
    for j in range(i+1,2*N):
      if Ball[j][0]=="B":
        if Ball[j][1]<Ball[i][1]:
          B_table[Ball[i][1]-1][0]+=1
      elif Ball[j][0]=="W":
        B_table[c][Ball[j][1]]+=1
    for k in range(N):
      B_table[c][k+1]+=B_table[c][k]
  elif Ball[i][0]=="W":
    W[c]=i+1
    for j in range(i+1,2*N):
      if Ball[j][0]=="W":
        if Ball[j][1]<Ball[i][1]:
          W_table[c][0]+=1
      elif Ball[j][0]=="B":
        W_table[c][Ball[j][1]]+=1
    for k in range(N):
      W_table[c][k+1]+=W_table[c][k]
dp=[[0]*(N+1) for i in range(N+1)]
for s in range(1,2*N+1):
  for b in range(max(0,s-N),min(s,N)+1):
    if b==0:
      dp[0][s]=dp[0][s-1]+(W[s-1]+W_table[s-1][0]-s)
    elif b==s:
      dp[s][0]=dp[s-1][0]+(B[s-1]+B_table[s-1][0]-s)
    else:
      dp[b][s-b]=min(dp[b-1][s-b]+(B[b-1]+B_table[b-1][s-b]-s),dp[b][s-b-1]+(W[s-b-1]+W_table[s-b-1][b]-s))
print(dp[N][N])

   #
import fractions

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

a_re = []
b_re = []

for i in range(max(A,B)//2 +1):
    if i == 0:
        continue
    if A % i ==0:
        a_re.append(i)
    if B % i ==0:
        b_re.append(i)

result = list (set(a_re) & set( b_re))
result.sort(reverse=True)

#print(result)
print(result[K-1])


### FIXED CODE ###

import fractions

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

a_re = []
b_re = []

for i in range(max(A,B) + 1):
    if i == 0:
        continue
    #print(i)
    if A % i ==0:
        a_re.append(i)
    if B % i ==0:
        b_re.append(i)
#print(a_re)

result = list (set(a_re) & set( b_re))

result.sort(reverse=True)
print(result[K-1])
import sys
from math import ceil, sqrt
def input(): return sys.stdin.readline().strip()


def main():
    X = int(input())
    x = int(X ** (1/5))
    if x == X ** (1/5):
        print("{} {}".format(x, 0))
        return
    
    for B in range(1, x + 1):
        A = (X - B**5) ** (1/5)
        if A < B: break
        if int(A) == A:
            print("{} {}".format(int(A), -B))
            return
    
    y = sqrt(X)
    if int(y) == y:
        upper = int(y) + 1
    else:
        upper = ceil(y)

    for d in range(1, upper):
        """
        if X % d == 0:
            B = 1
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return
            
            e = X // d
            B = 1
            while (B + e) ** 5  < B ** 5 + X:
                B += 1
            if (B + e) ** 5 == B ** 5 + X:
                print("{} {}".format(B + e, B))
                return
        """
        B = 1
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return
            
            e = X // d
            B = 1
            while (B + e) ** 5  < B ** 5 + X:
                B += 1
            if (B + e) ** 5 == B ** 5 + X:
                print("{} {}".format(B + e, B))
                return



if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from math import ceil, sqrt
def input(): return sys.stdin.readline().strip()


def main():
    X = int(input())
    """
    # ここで丸め誤差が出たせいで数学的にはTrueなものがFalse扱いされていた！！！
    # （例：3125**(1/5) = 5.000000000000001）
    x = int(X ** (1/5))
    if x == X ** (1/5):
        print("{} {}".format(x, 0))
        return
    # 正しくは以下：
    """
    x = round(X ** (1/5))
    if x ** 5 == X:
        print("{} {}".format(x, 0))
        return
    
    for B in range(1, x + 1):
        """
        # ここも丸め誤差が出るので修正が必要
        A = (X - B**5) ** (1/5)
        if A < B: break
        if int(A) == A:
            print("{} {}".format(int(A), -B))
            return
        """
        A = round((X - B**5) ** (1/5))
        if A < B: break
        if A ** 5 + B ** 5 == X:
            print("{} {}".format(int(A), -B))
            return
    
    """
    ここも修正
    y = sqrt(X)
    if int(y) == y:
    """
    y = round(sqrt(X))
    if y ** 2 == X:
        upper = y + 1
    else:
        upper = y

    for d in range(1, upper):
        if X % d == 0:
            B = 1
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return
            
            e = X // d
            B = 1
            while (B + e) ** 5  < B ** 5 + X:
                B += 1
            if (B + e) ** 5 == B ** 5 + X:
                print("{} {}".format(B + e, B))
                return
       


if __name__ == "__main__":
    main()
n, k = list(map(int,input().split()))
a = list(map(int,input().split()))

now=1
count=0

cities = [1]+[0]*(n)

for i in range(1,k+1):
    tmp=a[now-1]
    if tmp in cities[:i]:
        init_city=cities.index(tmp)
        if init_city>k:
            print(cities[k])
        else:
            print(cities[init_city:i][(k-init_city)%(i-init_city)])
        break
    else:
        cities[i]=tmp
        now=tmp
else:
    print(tmp_city[init_city+1])

### FIXED CODE ###

n, k = map(int, input().split())
A = list(map(int, input().split()))
D = [0] * (n+1)
now = 1
for i in range(1, k+1):
    tmp = A[now-1]
    if not D[tmp]:
        now = tmp
        D[now] += i
    else:
        pre = D[tmp]
        loop = i - D[tmp]
        if loop>1:
            now=D.index((k - pre) % loop + pre)
        else:
            now=tmp
        break
print(now)
count = 0
c = []
S = list(input())
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
    count += 1
  else:
    c.append(count)
    count = 0

print(max(c))

### FIXED CODE ###

count = 0
MAX = 0
S = list(input())
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
    count += 1
    if MAX < count:
        MAX = count
  else:
    count = 0

print(MAX)
x = int(input())
for i in range(x):
    if i*(i+1)/2 >= x:
        ans =i
        break 
    else:
        continue
print(ans)

### FIXED CODE ###

from math import ceil
x = int(input())
ans = ceil(((1+8*x)**.5 -1)/2)
print(ans)
def typical_stairs():
    n, m, dangerous = map(int, open(0).read().split())
    dangerous = set(dangerous)
    mod = 1000000007
    dp = [0] * (n + 1)
    dp[0] = 1
    if 1 not in dangerous:
        dp[1] = 1
    for i in range(2, n + 1):
        if i not in dangerous:
            dp[i] = (dp[i - 2] + dp[i - 1]) % mod
    print(dp[-1])


if __name__ == '__main__':
    typical_stairs()


### FIXED CODE ###

def typical_stairs():
    n, m = map(int, input().split())
    dangerous = set(int(input()) for _ in range(m))
    mod = 1000000007
    dp = [0] * (n + 1)
    dp[0] = 1
    if 1 not in dangerous:
        dp[1] = 1
    for i in range(2, n + 1):
        if i not in dangerous:
            dp[i] = dp[i - 2] + dp[i - 1]
    print(dp[-1] % mod)


if __name__ == '__main__':
    typical_stairs()
n,m = list(map(int,input().split()))
ans = [-1]*n
if m == 0:
    print(0)
else:
    for i in range(m):
        s,c = list(map(int,input().split()))
        if ans[s-1] != -1 and ans[s-1] != c:
            ans = -1
            break
        ans[s-1] = c
        if s == 1 and n != 1 and c == 0:
            ans = -1
            break    
    if ans[0] == -1:
        print(-1)
    elif ans != -1:
        for i in range(n):
            if ans[i] == -1:
                ans[i] = '0'
            else:
                ans[i] = str(ans[i])
        print(''.join(ans))
    else:
        print(ans)

### FIXED CODE ###

n,m = list(map(int,input().split()))
ans = [-1]*n
for i in range(m):
    s,c = list(map(int,input().split()))
    if ans[s-1] != -1 and ans[s-1] != c:
        ans = -1
        break
    ans[s-1] = c
    if s == 1 and n != 1 and c == 0:
        ans = -1
        break    

if ans != -1:
    if ans[0] == -1 and n != 1:
        ans[0] = 1
    for i in range(n):
        if ans[i] == -1:
            ans[i] = '0'
        else:
            ans[i] = str(ans[i])
    print(''.join(ans))
else:
    print(ans)
S = input()
if S[1] = "B":
  S[1] = "R"
else:
  S[1] = "B"
print(S)

### FIXED CODE ###

S = input()
if S[1] == "B":
  print("ARC")
else:
  print("ABC")
# -*- coding: utf-8 -*-
import collections
import math
import copy

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

def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
    return data

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

max_num = max(A)
data = get_sieve_of_eratosthenes(max_num)
select_prime = list(set(data) & set(A))
remove_prime = sorted(list(set(A).difference(set(data))))

if len(remove_prime)==0:
    print(0)
else:
    for min_num in remove_prime:
        divisor = make_divisors(min_num) 
        remove_max = sorted(divisor)[:-1] 
        if (list(set(remove_prime)&set(remove_max))==[])&(list(set(select_prime)&set(remove_max))==[]):
            select_prime.append(min_num)
    print(len(select_prime))

### FIXED CODE ###

#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    it = map(int, sys.stdin.read().split())
    N = next(it)
    A = [next(it) for i in range(N)]

    if N == 1:
        print(1)
        return

    ax = max(A)+1
    dp = [0]*ax
    for ai in A:
        da = dp[ai]
        if da > 1:
            continue
        dp[ai] += 1
        if da == 0:
            for aj in range(2*ai, ax, ai):
                dp[aj] = 2
    ans = 0
    for ai in A:
        if dp[ai] == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    resolve()
def main():
    N, K = map(int, input().split())
    Nodes = [set() for _ in range(N)]
    MOD = 10 ** 9 + 7
    for i in range(N - 1):
        a, b = map(int, input().split())
        Nodes[a - 1].add(b - 1)
        Nodes[b - 1].add(a - 1)
    def helper(n, k, f):
        l = len(Nodes[n])
        r = (K - k) 
        j = 1 if k == 0 else 2
        for i in Nodes[n]:
            if i == f:
                continue
            r = r * helper(i, j, n) % MOD
            j += 1
        return r
    for i in range(N):
        if len(Nodes[i]) == 1:
            break
    return helper(i, 0, -1)

print(main())


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
def main():
    N, K = map(int, input().split())
    Nodes = [set() for _ in range(N)]
    MOD = 10 ** 9 + 7
    for i in range(N - 1):
        a, b = map(int, input().split())
        Nodes[a - 1].add(b - 1)
        Nodes[b - 1].add(a - 1)
    def helper(n, k, f):
        l = len(Nodes[n])
        r = (K - k) 
        j = 1 if k == 0 else 2
        for i in Nodes[n]:
            if i == f:
                continue
            r = r * helper(i, j, n) % MOD
            j += 1
        return r
    for i in range(N):
        if len(Nodes[i]) == 1:
            break
    return helper(i, 0, -1)

print(main())
N,W=map(int,input().split())
w,v=[],[]
for i in range(N):
    weight, value = map(int,input().split())
    w.append(weight)
    v.append(value)
dp = [[0 for _ in range(10*9)] for _ in range(N+1)]
for i in range(N):
    for sum_w in range(W+1):
        if sum_w -w[i] >=0:
            dp[i+1][sum_w] = max(dp[i+1][sum_w],dp[i][sum_w-w[i]] + v[i])
        dp[i+1][sum_w]=max(dp[i+1][sum_w],dp[i][sum_w])
print(dp[N][W])

### FIXED CODE ###

n,w=map(int,input().split())
weight,value=[0]*110,[0]*110
dp = [[0 for _ in range(100100)] for _ in range(110)]
for i in range(n):
    weight[i],value[i] = map(int,input().split())
for i in range(n):
    sum_w =0
    while sum_w <= w:
        #i番目の品物を選ぶ
        if(sum_w - weight[i] >=0):
            dp[i+1][sum_w] =max(dp[i+1][sum_w], dp[i][sum_w - weight[i]]+ value[i])
        #選ばない場合
        dp[i + 1][sum_w] = max(dp[i + 1][sum_w], dp[i][sum_w])
        sum_w +=1
print(dp[n][w])
import itertools
n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
l = list(range(1, n + 1))
ll = list(itertools.permutations(l, n))

for i in ll:
    if i == p:
        p_n = ll.index(i) + 1
    elif i == q:
        q_n = ll.index(i) + 1
ans = abs(p_n - q_n)
print(ans)

### FIXED CODE ###

import itertools
n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
l = list(range(1, n + 1))
ll = list(itertools.permutations(l, n))
if p == q:
    ans = 0
else:
    for i in ll:
        if i == p:
            p_n = ll.index(i) + 1
        elif i == q:
            q_n = ll.index(i) + 1
    ans = abs(p_n - q_n)
print(ans)
SA = input()
SB = input()
SC = input()

A = []
for i in range(len(SA)):
    tmp = SA[i]
    A.append(tmp)

B = []
for i in range(len(SB)):
    tmp = SB[i]
    B.append(tmp)

C = []
for i in range(len(SC)):
    tmp = SC[i]
    C.append(tmp)

suteru = A[0]
A.remove(A[0])

lenA = len(A)

have = True
while have:
    if suteru == "a":
        suteru = A[0]
        A.remove(A[0])
        if len(A) == 0:
            moji = "A"
            have = False
    elif suteru == "b":
        suteru = B[0]
        B.remove(B[0])
        if len(B) == 0:
            moji = "B"
            have = False
    elif suteru == "c":
        suteru == C[0]
        C.remove(C[0])
        if len(C) == 0:
            moji = "C"
            have = False

if lenA == 1:
    print("A")
else:
    print(moji)
    

### FIXED CODE ###

A = input()
B = input()
C = input()

throw = "a"
a = 0
b = 0
c = 0

while True:
    if throw == "a":
        if a == len(A):
            print("A")
            break       
        throw = A[a]
        a += 1
    elif throw == "b":
        if b == len(B):
            print("B")
            break
        throw = B[b]
        b += 1
    elif throw == "c":
        if c == len(C):
            print("C")
            break
        throw = C[c]
        c += 1
import math
X = input().split(" ")
A = int(X[0])
B100 = float(X[1])*100
ab = math.floor(A*B)//100
print(str(ab))


### FIXED CODE ###

X = input().split(" ")
A = int(X[0])
B = int( float(X[1])*1000 )

m = A * B
m = m // 1000

print(m)
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

# ソートする
hp_list.sort(reverse=True)

# 必殺技の回数ぶん除去
for i in range(k):
    hp_list.pop(0)

sum_hp = 0
for hp in hp_list:
    sum_hp += hp

print(sum_hp)




### FIXED CODE ###

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

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

if n < k:
    print(0)
    exit()

# ソートする
hp_list.sort()

# 必殺技の回数ぶん除去
for i in range(k):
    hp_list.pop()

sum_hp = 0
for hp in hp_list:
    sum_hp += hp

print(sum_hp)
n,m=map(int,input().split())
s=input()
t=input()

def gcd(x,y):
  r=x%y
  return gcd(y,r) if r else y
#最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

L=lcm(n,m)
if s[0]==t[0]:
  X=[""]*(L+1)
else:
  print(-1)
  exit()
for i in range(1,n):
  X[int(i*L/n)+1]=s[i]
for i in range(1,m):
  if X[int(i*L/m)+1] !="":
    if X[int(i*L/m)+1] !=t[i]:
      print(-1)
      exit()
print(L)

### FIXED CODE ###

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

def gcd(x,y):
  r=x%y
  return gcd(y,r) if r else y
#最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

L=lcm(n,m)
g=gcd(n,m)
for i in range(g):
  if s[int(i*n/g)]!=t[int(i*m/g)]:
    print(-1)
    exit()
print(L)
tmp = 10 ** 9 + 7
def div(n,T):
    _ = 1
    for t in range(T):
        _ *= n
        _ %= tmp
    return _
    
N = int(input())
a = div(10,N)
b = div(9,N)
c = div(8,N)

print((a + c - 2 * b) % tmp)


### FIXED CODE ###

n = int(input())
print(1 if not n else 0)
n = input()
for i in range(n):
 a = map(int,raw_input().split())

print min(a),max(a),sum(a)

### FIXED CODE ###

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

print min(a),max(a),sum(a)
print("Yes" if int(input()) * 500 >= int(input()) else "No")

### FIXED CODE ###

K, X = map(int, input().split())
print("Yes" if K * 500 >= X else "No")
from statistics import mode
N = int(input())
arr = list(map(int, input().split()))
for i in range(N):
    arr[i] = arr[i]-(i+1)
if len(arr) == len(set(arr)):
    sad = 0
else:
    sad = mode(arr)
ans = 0
for i in arr:
    ans += abs(i-sad)
print(ans)

### FIXED CODE ###

N = int(input())
arr = list(map(int, input().split()))
for i in range(N):
    arr[i] = arr[i]-(i+1)
arr.sort()
sad = arr[N//2]
ans = 0
for i in arr:
    ans += abs(i-sad)
print(ans)
N,i=map(int,input())
print(N-i+1)


### FIXED CODE ###

N,i=map(int,input().split())
print(N-i+1)
n=int(input())
for i in range(n):
    a.append(input())
if len(a)!=len(set(a)):
    print('No')
    exit()
for i in range(n-1):
    if a[i][-1]!=a[i+1][0]:
        print('No')
        exit()
print('Yes')

### FIXED CODE ###

n=int(input())
a=[]
for i in range(n):
    a.append(input())
if len(a)!=len(set(a)):
    print('No')
    exit()
for i in range(n-1):
    if a[i][-1]!=a[i+1][0]:
        print('No')
        exit()
print('Yes')
a=input()
b=input()
c=input()
t="a"
while a!=[] and b!=[] and c!=[]:
  if t=="a":
    t=a[0]
    del a[0]
  elif t=="b":
    t=b[0]
    del b[0]
  else:
    t=c[0]
    del c[0]
if a==[]:
  print("A")
elif b==[]:
  print("B")
else:
  print("C")
          
  

### FIXED CODE ###

a=list(input())
b=list(input())
c=list(input())
t="a"
a.append(0)
b.append(0)
c.append(0)
while a!=[] and b!=[] and c!=[]:
  if t=="a":
    t=a[0]
    del a[0]
  elif t=="b":
    t=b[0]
    del b[0]
  else:
    t=c[0]
    del c[0]
if a==[]:
  print("A")
elif b==[]:
  print("B")
else:
  print("C")
W = input()

while True:
    line = input()
    if line == 'END_OF_TEXT':
        break

    for  s in line.lower().split():
        if s == W:
            count += 1
            
print(count)

### FIXED CODE ###

W = input()

count = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break

    for  s in line.lower().split():
        if s == W:
            count += 1
            
print(count)
import sys
input = sys.stdin.readline

print(len(input()) * 'X)

### FIXED CODE ###


s = str(input())
print(len(s) * "x")