Harryxun/stf_run huggingface dataset:
import sys
from collections import deque
input = sys.stdin.readline

def main(*args, **kwargs):
    # Initialize data
    H, W = map(int, input().split())
    total_cells = H * W
    existing_black_cells = 0

    grid = []
    for i in range(H):
        line = input()
        existing_black_cells += line.count('#')
        grid.append(line)

    # Initialize Search
    queue = deque()
    queue.append((0, 0))  # start point
    visited = set()
    movement = 0

    while len(queue) > 0:
        movement += 1
        for i in range(len(queue)):  # Process same level
            coodinate = queue.popleft()
            visited.add(coodinate)
            y = coodinate[0]
            x = coodinate[1]

            # Terminate condition
            if y == H - 1 and x == W - 1:
                print(total_cells - movement - existing_black_cells)
                return

            for dx, dy in [(1, 0), (0, 1), (-1, 0), (0, -1)]:
                X = x + dx
                Y = y + dy
                adjacent = (Y, X)
                if 0 <= X < W and 0 <= Y < H and grid[Y][X] == '.' and adjacent not in visited:
                    queue.append(adjacent)
    print(-1)
    return
main()

### FIXED CODE ###

N = int(input())
A = int(input())
condition = (N % 500 <= A)
print('Yes' if condition is True else 'No')
x, a = map(int,input().split())
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

x, a = readmi()
if x > a:
    print(10)
else:
    print(0)

### FIXED CODE ###

# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

x, a = map(int,input().split())
if x < a:
    print(0)
else:
    print(10)
n,k = int(input().split(" "))
import math
print(int(math.ceil(math.log(n)/math.log(k) )))

### FIXED CODE ###

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

import math
a = (int(math.ceil(math.log(n)/math.log(k) )))
if a==0:
  print(1)
else:
  print(a)
n = int(input())
k = int(input())
n_len = len(str(n))

x = [1]*(n_len)
for i in range(n_len-1):
    x[i+1] = x[i]*(i+1)

def calc(i,j):
    return x[i]/x[j]/x[i-j]*9**(j)
    
count = 0
non_zero = 0
for ind,i in enumerate(str(n)):
    if i != '0':
        non_zero += 1
        if n_len-ind-1 > k-non_zero:
            count += calc(n_len-ind-1,k-non_zero+1)
        if non_zero < k:
            count += calc(n_len-ind-1,k-non_zero)*(int(i)-1)
        elif non_zero == k:
            count += int(i)
            break
    
print(int(count))

### FIXED CODE ###

n = input()
k = int(input())
n_len = len(n)
dp0 = [[0]*k for i in range(n_len)]
dp1 = [[0]*k for i in range(n_len)]
for i in range(k):
    if i == 0:
        dp0[0][i]=int(n[0])-1
        dp1[0][i]=1
    else:
        dp0[0][i]=0
        dp1[0][i]=0

for i in range(1,n_len):
    for j in range(k):
        if j == 0:
            dp0[i][j]=9 + dp0[i-1][0] + dp1[i-1][0]*min(1,int(n[i]))
            dp1[i][j]=dp1[i-1][0] if int(n[i]) == 0 else 0
        else:
            dp0[i][j]=dp0[i-1][j-1]*9 + dp1[i-1][j-1]*max(0,int(n[i])-1) + dp0[i-1][j] + dp1[i-1][j]*min(1,int(n[i]))
            dp1[i][j]=dp1[i-1][j-1] if int(n[i]) != 0 else dp1[i-1][j]
            
print(dp0[n_len-1][k-1]+dp1[n_len-1][k-1])
S = list(input())
pair = []
cnt = 0
now = S[0]
s, t = 0, 0
for i in range(1, len(S)-1):
  
  if now == 'R' and S[i+1] == 'L':
    pair += [[i, i+1]]
    now = 'L'
  if now == 'L' and S[i+1] == 'R':
    pair[-1] += [t+1-s+1]
    now = 'R'
    s = t+2
  t += 1

pair[-1] += [t+1-s+1]
result = [0]*len(S)
for a, b, p in pair:
  if p % 2 == 0:
    result[a] = p // 2
    result[b] = p // 2
  else:
    result[a] = p // 2 + 1
    result[b] = p // 2
result = list(map(str, result))
print(" ".join(result))

### FIXED CODE ###

S = list(input())
pair = []
cnt = 0
now = S[0]
if len(S) == 2:
  print(1, 1)
  exit()
s, t = 0, 0
for i in range(len(S)-1):
  if now == 'R' and S[i+1] == 'L':
    pair += [[i, i+1]]
    now = 'L'
  if now == 'L' and S[i+1] == 'R':
    pair[-1] += [s, t]
    now = 'R'
    s = t+1
  t += 1


pair[-1] += [s, t]
result = [0]*len(S)
for a, b, s, t in pair:
  p = t - s + 1
  if p % 2 == 0:
    result[a] = p // 2
    result[b] = p // 2
  else:
    a_even = (a-s)//2 + (t-a)//2 + 1
    b_even = p-a_even
    result[a] = a_even
    result[b] = b_even
result = list(map(str, result))
print(" ".join(result))
n, m = map(int, input().split())
s, t = list(input()), list(input())


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


def lcm(a, b):
    return a * b // gcd(a, b)


l = lcm(len(s), len(t))
x = ["無"] * l
for i in range(0, len(s)):
    x[i * (l // len(s))] = s[i]
for i in range(0, len(t)):
    if x[i * (l // len(t))] == "無":
        continue
    else:
        if x[i * (l // len(t))] != t[i]:
            print(-1)
            exit()
print(l)

### FIXED CODE ###

# たぶん最小の値は最小公倍数になりそう
# 内包表記 -> TLE
# [0]*l -> RE

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


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


def lcm(a, b):
    return (a * b) // gcd(a, b)


l = lcm(n, m)
arr = {}

for i in range(n):
    x = i * (l // n)
    arr[x] = s[i]

for i in range(m):
    x = i * (l // m)
    if x in arr and arr[x] != t[i]:
        print(-1)
        exit()
print(l)
lis=list(map(int,input().split()))
alist=[]
for i in range(lis[1]):
    alist.append(int(input()))
flag=0
ans=0
steps=[0]*(lis[0]+1)
if 1 in alist:
    steps[1]=0
    steps[2]=1
elif 2 in alist:
    steps[1]=1
    steps[2]=0
else:
    steps[1]=1
    steps[2]=2
for i in range(3,lis[0]+1):
    if i not in alist:
        steps[i]=(steps[i-1]+steps[i-2])%((10**9)+7)
ans=steps[-1]

print(ans)


### FIXED CODE ###

lis=list(map(int,input().split()))
alist=[0]*(lis[0]+1)
for i in range(lis[1]):
    a=int(input())
    alist[a]=1
steps=[0]*(lis[0]+2)
steps[1]=1
mod=(10**9)+7
for i in range(2,lis[0]+2):
    if alist[i-1]==0:
        steps[i]=(steps[i-1]+steps[i-2])%mod
ans=steps[-1]
print(ans)
# D
N = int(input())
s = list(map(int, list(input())))

        
def calc_add(temp_list):
    if len(temp_list) <= 1:
        return 0
    else:
        res = 0
        # use 101 for left
        dp_l = [0]*len(temp_list)
        # use 101 for right 
        dp_r = [0]*len(temp_list)
        # do not use 101
        dp_c = [0]*len(temp_list)
        for i in range(len(temp_list) - 1):
            if temp_list[i] > 1:
                dp_l[i+1] = max(dp_l[i] + temp_list[i] - 1, dp_c[i] + temp_list[i])
            else:
                dp_l[i+1] = dp_c[i] + temp_list[i]
            if temp_list[i] > 1:
                dp_r[i+1] = max(dp_l[i] + temp_list[i+1], dp_c[i] + temp_list[i+1], dp_r[i] + temp_list[i+1] - 1)
            else:
                dp_r[i+1] = dp_c[i] + temp_list[i+1]
            dp_c[i+1] = max(dp_l[i], dp_r[i], dp_c[i])
        
        return max(dp_l[-1], dp_r[-1], dp_c[-1])
    

cont0 = 1
cont00 = 1
temp_list = []
res = 0

for i in range(N):
    if s[i] == 1:
        if cont0 == 1:
            temp_list.append(1)
            cont0 = 0
            cont00 = 0
        else:
            temp_list[-1] += 1
    else:
        if cont00 == 1:
            pass
        elif cont0 == 1:
            cont00 = 1
            res += calc_add(temp_list)
            temp_list = []
        else:
            cont0 = 1
            
    if i == M:
        res += calc_add(temp_list)
        
print(res)

### FIXED CODE ###

# D
N = int(input())
s = list(map(int, list(input())))

        
def calc_add(temp_list):
    if len(temp_list) <= 1:
        return 0
    else:
        res = 0
        # use 101 for left
        dp_l = [0]*len(temp_list)
        # use 101 for right 
        dp_r = [0]*len(temp_list)
        # do not use 101
        dp_c = [0]*len(temp_list)
        for i in range(len(temp_list) - 1):
            if temp_list[i] > 1:
                dp_l[i+1] = max(dp_l[i] + temp_list[i] - 1, dp_c[i] + temp_list[i])
            else:
                dp_l[i+1] = dp_c[i] + temp_list[i]
            if temp_list[i] > 1:
                dp_r[i+1] = max(dp_l[i] + temp_list[i+1], dp_c[i] + temp_list[i+1], dp_r[i] + temp_list[i+1] - 1)
            else:
                dp_r[i+1] = dp_c[i] + temp_list[i+1]
            dp_c[i+1] = max(dp_l[i], dp_r[i], dp_c[i])
        
        return max(dp_l[-1], dp_r[-1], dp_c[-1])
    

cont0 = 1
cont00 = 1
temp_list = []
res = 0

for i in range(N):
    if s[i] == 1:
        if cont0 == 1:
            temp_list.append(1)
            cont0 = 0
            cont00 = 0
        else:
            temp_list[-1] += 1
    else:
        if cont00 == 1:
            pass
        elif cont0 == 1:
            cont00 = 1
            res += calc_add(temp_list)
            temp_list = []
        else:
            cont0 = 1
            
    if i == N - 1:
        res += calc_add(temp_list)
        
print(res)
a = input()
print(a + a*a + a*a*a)

### FIXED CODE ###

a = input()
a = int(a)
print(a + a**2 + a**3)
#122c
N,Q = map(int, input().split())
S = str(input())

for _ in range(Q):
    l,r = map(int, input().split())
    print(S[l-1:r].count('AC'))

### FIXED CODE ###

S = list(input())
ACGT = set(["A","C","G","T"])
ans = 0
acgt_length = 0

for i in range(len(S)):
  if S[i] in ACGT:
    acgt_length += 1
  else:
    ans = max(ans,acgt_length)
    acgt_length = 0
    
ans = max(ans,acgt_length)

print(ans)
a,b=map(int,input().split())
n=[1,3,5,7,8,10,12]
m=[4,6,9,11]
o=[2]
p=[n,m,o]
if count(a)==count(b):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b=map(int,input().split())
n=[1,3,5,7,8,10,12]
m=[4,6,9,11]
o=[2]
p=[n,m,o]
if (a in n and b in n) or (a in m and b in m) or (a in o and b in o):
  print('Yes')
else:
  print('No')
n = int(input())
slist = []
for i in range(n):
    s = sorted(list(input()))
    slist.append(s)

common = [s for s in slist[0]]

for i in range(1,n):
    poplist = []
    for j in range(len(common)):
        if common[j] in slist[i]:
            slist[i].remove(common[j])
        else:
            poplist.append(j)
    for j in range(len(poplist)):
        common.pop(poplist[j])
    #print(common)

print(''.join(common))







### FIXED CODE ###

n = int(input())
slist = [input()for i in range(n)]

alp = {chr(i):float('inf') for i in range(97,97+26)}

for i in range(len(slist)):
    sdic = {chr(i):0 for i in range(97,97+26)}
    for j in range(len(slist[i])):
        sdic[slist[i][j]] += 1
    
    for k in alp:
        alp[k] = min(alp[k],sdic[k])

alplist = sorted(list(alp.items()))
ans = ''
for i in range(26):
    ans += alplist[i][0]*alplist[i][1]
print(ans)
_ = input()
A = [int(i) for i in input().split(" ")]
for i in range(1, len(A)):
  print(" ".join(A))
  key = A[i]
  j = i - 1
  while j >= 0 and A[j] > key:
    A[j + 1] = A[j]
    j -= 1
  A[j] = key

### FIXED CODE ###

_ = input()
A = [int(a) for a in input().split(" ")]
for i in range(1, len(A)):
  print(" ".join([str(a) for a in A]))
  key = A[i]
  j = i - 1
  while j >= 0 and A[j] > key:
    A[j + 1] = A[j]
    j -= 1
  A[j + 1] = key
print(" ".join([str(a) for a in A]))
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]))
n, w = map(int, input().split())
goods = [list(map(int, input().split())) for _ in range(n)]
dp = [[0] * (w + 1) for _ in range(n + 1)]
for i in range(n):
    for j in range(w + 1):
        if 0 <= j - goods[i][0]:
            dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - goods[i][0]] + goods[i][1])
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])

for i in range(n + 1):
    print(dp[i])
print(dp[n][w])


### FIXED CODE ###

n, w = map(int, input().split())
goods = [list(map(int, input().split())) for _ in range(n)]
dp = [[float("INF")] * (10 ** 5 + 1) for _ in range(n + 1)]
dp[0][0] = 0

for i in range(n):
    for j in range(10 ** 5 + 1):
        if 0 <= j - goods[i][1]:
            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - goods[i][1]] + goods[i][0])
        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])


M = 0
for i in range(10 ** 5 + 1):
    if dp[n][i] <= w:
        M = i
print(M)
order = input()
forw = int(order[:2])
back = int(order[2:])
flg_f = 0
flg_b = 0

if forw<=12 and forw != 0:
  flg_m = 1
if back<=12 and back != 0:
  flg_b = 1

if flg_m + flg_b == 2:
  print('AMBIGUOUS')
elif flg_m == 1:
  print('MMYY')
elif flg_b == 1:
  print('YYMM')
else:
  print('NA')

### FIXED CODE ###

order = input()
forw = int(order[:2])
back = int(order[2:])
flg_f = 0
flg_b = 0
 
if forw<=12 and forw != 0:
  flg_f = 1
if back<=12 and back != 0:
  flg_b = 1

if flg_f + flg_b == 2:
  print('AMBIGUOUS')
elif flg_f == 1:
  print('MMYY')
elif flg_b == 1:
  print('YYMM')
else:
  print('NA')
n, u, v = map(int, input().split())
u, v = u-1, v-1
edges = [[] for i in range(n)]
for i in range(n-1):
    ai, bi = map(int, input().split())
    ai, bi = ai-1, bi-1
    edges[ai].append(bi)
    edges[bi].append(ai)

def dfs(already, node, depth):
    depth += 1
    children = edges[node]
    for child in children:
        if already[child] == 0:
            already[child] = depth
            already = dfs(already, child, depth)
    return already

already_u = [0 for i in range(n)]
already_u[u] = -1
already_u = dfs(already_u, u, 0)
already_u[u] = 0
already_v = [0 for i in range(n)]
already_v[v] = -1
already_v = dfs(already_v, v, 0)
already_v[v] = 0

maxi = 0
for i in range(n):
    if already_u[i] < already_v[i]:
        maxi = max(maxi, already_v[i])
print(maxi-1)

### FIXED CODE ###

n, u, v = map(int, input().split())
u, v = u-1, v-1
edges = [[] for i in range(n)]
for i in range(n-1):
    ai, bi = map(int, input().split())
    ai, bi = ai-1, bi-1
    edges[ai].append(bi)
    edges[bi].append(ai)

depth = 0
already = [0 for i in range(n)]
already[v] = 1
nodes = [v]
while nodes != []:
    depth += 1
    next_nodes = []
    for node in nodes:
        children = edges[node]
        for child in children:
            if already[child] == 0:
                already[child] = depth
                next_nodes.append(child)
    nodes = next_nodes
already[v] = 0

depth = 0
already_u = [0 for i in range(n)]
already_u[u] = 1
nodes = [u]
while nodes != []:
    depth += 1
    next_nodes = []
    for node in nodes:
        children = edges[node]
        for child in children:
            if already_u[child] == 0:
                already_u[child] = depth
                next_nodes.append(child)
    nodes = next_nodes
already_u[u] = 0

maxi = 0
for i in range(n):
    if already_u[i] < already[i]:
        maxi = max(maxi, already[i])

print(maxi-1)
n=int(input())
s=[input() for num in range(n)]
for i in range(97,97+26,1):
	s0=s[0].count(chr(i))
	s1=s[1].count(chr(i))
	s2=s[2].count(chr(i))
	count=(min(s0,min(s1,s2)))
	for j in range(count):
		print(chr(i),end="")

### FIXED CODE ###

n=int(input())
s=[input() for num in range(n)]
for i in range(97,97+26,1):
	list=[]
	for j in range(n):
		list.append(s[j].count(chr(i)))
	print(chr(i)*min(list),end="")
import numpy as np
s = list(input())
x, y = map(int, input().split())

X = [0]
Y = [0]

flag = True
tmp = 0
for i in s:
    if i == 'F':
        tmp += 1
    else:
        if flag:
            X.append(tmp)
        else:
            Y.append(tmp)
        tmp = 0
        flag = not flag

if flag:
    X.append(tmp)
else:
    Y.append(tmp)

# print (X)
# print (Y)

x -= X[1]
X[1] = 0

x = abs(x)
y = abs(y)

total_X = sum(X)
total_Y = sum(Y)

lst_X = np.zeros(total_X + 1)
lst_X[0] = 1
for i in X:
    if i == 0:
        continue
    print (lst_X[i:])
    print (lst_X[:-i])
    lst_X[i:] = max(lst_X[i:], lst_X[:-i])

# print (lst_X)

lst_Y = np.zeros(total_Y + 1)
lst_Y[0] = 1
for i in Y:
    if i == 0:
        continue
    lst_Y[i:] = max(lst_Y[i:], lst_Y[:-i])

if x > total_X or y > total_Y:
    print ('No')
    exit()

if (total_X - x) % 2 == (total_Y - y) % 2 == 0 and int(lst_X[(total_X - x) // 2]) == 1 and int(lst_Y[(total_Y - y) // 2]) == 1:
    print ('Yes')
else:
    print ('No')

### FIXED CODE ###

s = list(input())
x, y = map(int, input().split())

X = [0]
Y = [0]

flag = True
tmp = 0
for i in s:
    if i == 'F':
        tmp += 1
    else:
        if flag:
            X.append(tmp)
        else:
            Y.append(tmp)
        tmp = 0
        flag = not flag

if flag:
    X.append(tmp)
else:
    Y.append(tmp)

# print (X)
# print (Y)

x -= X[1]
X[1] = 0

x = abs(x)
y = abs(y)

total_X = sum(X)
total_Y = sum(Y)

lst_X = [0] * (total_X + 1)
lst_X[0] = 1
for i in X:
    if i == 0:
        continue
    for j in range(total_X - i, -1, -1):
        if lst_X[j] == 1:
            lst_X[j + i] = 1

# print (lst_X)

lst_Y = [0] * (total_Y + 1)
lst_Y[0] = 1
for i in Y:
    if i == 0:
        continue
    for j in range(total_Y - i, -1, -1):
        if lst_Y[j] == 1:
            lst_Y[j + i] = 1

# print (lst_Y)
if x > total_X or y > total_Y:
    print ('No')
    exit()

if (total_X - x) % 2 == (total_Y - y) % 2 == 0 and lst_X[(total_X - x) // 2] == 1 and lst_Y[(total_Y - y) // 2]:
    print ('Yes')
else:
    print ('No')
import re

N, Q = [int(item) for item in re.split(r"\s", input())]
s = input()
t = []
d = []
for _ in range(Q):
    t_in, d_in = [item for item in re.split(r"\s", input())]
    t.append(t_in)
    d.append(d_in)


def check(i, LR):
    """Return False when drop

    Args:
        i ([type]): [description]
    """

    for q in range(Q):
        if t[q] == s[i]:
            if d[q] == "L":
                i -= 1
            if d[q] == "R":
                i += 1

            if LR == "L" and i < 0 or LR == "R" and i > N-1:
                return False
    return True


s_index = 0  # include
e_index = N-1  # include
while e_index-s_index >= 2:
    c_index = (e_index-s_index+1)//2+s_index  # center or +1
    if check(c_index, "L"):
        # doesn't drop
        e_index = c_index
    else:
        s_index = c_index

pat1, pat2 = check(s_index, "L"), check(e_index, "L")
if pat1:
    left = s_index-1
elif pat2:
    left = s_index
else:
    left = e_index


s_index = 0  # include
e_index = N-1  # include
while e_index-s_index >= 2:
    c_index = (e_index-s_index+1)//2+s_index  # center or +1
    if check(c_index, "R"):
        # doesn't drop
        s_index = c_index
    else:
        e_index = c_index

pat1, pat2 = check(s_index, "R"), check(e_index, "R")
if pat2:
    right = e_index+1
elif pat1:
    right = e_index
else:
    right = s_index

print(right-left-1)


### FIXED CODE ###

N, Q = map(int, input().split())
s = input()
TD = [input().split() for i in range(Q)]


def simulate(n):
    if n == -1:
        return -1
    if n == N:
        return 1
    for t, d in TD:
        if t == s[n]:
            if d == "L":
                n -= 1
            else:
                n += 1
        if n == -1:
            return -1
        elif n == N:
            return 1
    return 0


l = -1
r = N
while l+1 < r:
    n = (l+r)//2
    sim = simulate(n)
    if sim == -1:
        l = n
    else:
        r = n
L = l

l = -1
r = N
while l+1 < r:
    n = (l+r)//2
    sim = simulate(n)
    if sim == 1:
        r = n
    else:
        l = n
R = r
print(R-L-1)
X = int(input())
if X == "A":
  	print("T")
elif X == "T":
  	print("A")
elif X == "C":
  	print("G")
elif X == "G":
	print("C")

### FIXED CODE ###

X = input()
if X == "A":
  	print("T")
elif X == "T":
  	print("A")
elif X == "C":
  	print("G")
elif X == "G":
	print("C")
import math


A, B = map(int, input().split())
lcm = A * B / math.gcd(A, B)
print(int(lcm))

### FIXED CODE ###

import fractions


A, B = map(int, input().split())
lcm = A * B / fractions.gcd(A, B)
print(int(lcm))
N = int(input())
B = input()


B_1 = B.count("1")
mod_list_m1 = []
mod_list_p1 = []

mod_m1 = 0
mod_p1 = 0
for i in range(N):
  	if B_1 != 1:
        mm1 = (2**(N-i-1)) % (B_1-1)
        mod_list_m1.append(mm1)
        mod_m1 += int(B[i])*mm1
    mp1 = (2**(N-i-1)) % (B_1+1)
    mod_list_p1.append(mp1)
    mod_p1 += int(B[i])*mp1

def calc_small(n, iter):
    iter += 1
    mod = n % bin(n).count("1")

    if mod == 0:
        return iter
    else:
        return calc_small(mod, iter)

for i in range(N):
  	if B_1 == 1 and int(B[i]) == 1:
      	print(0)
        continue
    mod = (mod_m1 - mod_list_m1[i]) % (B_1-1) if int(B[i]) == 1 else (mod_p1 + mod_list_p1[i]) % (B_1+1)
    iter = 1
    if mod == 0:
        print(iter)
    else:
        print(calc_small(mod, iter))


### FIXED CODE ###

N = int(input())
B = input()

B_1 = B.count("1")
mod_p1 = int(B,2) % (B_1+1)
if B_1 != 1:
    mod_m1 = int(B,2) % (B_1-1)

def calc_small(n, iter):
    iter += 1
    mod = n % bin(n).count("1")

    if mod == 0:
        return iter
    else:
        return calc_small(mod, iter)

for i in range(N):
    if B_1 == 1 and int(B[i]) == 1:
        print(0)
        continue
    mod = (mod_m1 - pow(2,N-i-1,B_1-1)) % (B_1-1) if int(B[i]) == 1 else (mod_p1 + pow(2,N-i-1,B_1+1)) % (B_1+1)
    iter = 1
    if mod == 0:
        print(iter)
    else:
        print(calc_small(mod, iter))
nums = input().split()

if nums[0] = "0"
print(1)

elif nums[1] = "0"
print(2)

elif nums[2] = "0"
print(3)

elif nums[3] = "0"
print(4)

elif nums[4] = "0"
print(5)


### FIXED CODE ###

# coding: utf-8
# Your code here!
x=input().split()



if(x[0]=="0"):
    print(1)
elif(x[1]=="0"):
    print(2)
elif(x[2]=="0"):
    print(3)
elif(x[3]=="0"):
    print(4)
elif(x[4]=="0"):
    print(5)
N, M = list(map(int, input().split(' ')))
    r = [ None for i in range(N) ]
     
    illegal = False
    for i in range(M):
      s, c = list(map(int, input().split(' ')))
      if r[s-1] is not None and r[s-1] != c:
        illegal = True
        break
      r[s-1] = c
     
    v = -1
    if not illegal:
      for i in range(N):
        if r[i] is None:
          if i == 0 and N != 1:
            r[i] = 1
          else:
            r[i] = 0
      v = sum(r[i] * 10**i for i in range(N))
      if v < 10**(N-1) and not (N == 1 and v == 0):
        v = -1
     
    print(v)

### FIXED CODE ###

import math
print(math.ceil(int(input())/2))