Harryxun/stf_run huggingface dataset:
#A
"""
a, b, c = map(int, input().split())
print(min(b//a, c))
"""
#B
"""
a, b, k = map(int, input().split())
for i in range(max(a, b), 0, -1):
    if a % i == 0 and b % i == 0:
        k -= 1
        if k == 0:
             print(i)
"""

#C
s = input()
an0 = 0
an1 = 0
for i in s:
    if s == ""1":
        an1 += 1
    if s == "0":
        an0 += 1
print(min(an0, an1))

### FIXED CODE ###

#A
"""
a, b, c = map(int, input().split())
print(min(b//a, c))
"""
#B
"""
a, b, k = map(int, input().split())
for i in range(max(a, b), 0, -1):
    if a % i == 0 and b % i == 0:
        k -= 1
        if k == 0:
             print(i)
"""

#C
s = list(input())
an0 = 0
an1 = 0
for i in s:
    if i == "1":
        an1 += 1
    if i == "0":
        an0 += 1
print(min(an0, an1)*2)
#16D8101023J 久保田凌弥 kubotarouxxx python3

x=int(input())
y=int(input())

w=x*y
z=2*(x+y)

print(w,z)



### FIXED CODE ###

#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, input().split())
w=x*y
z=2*x+2*y

print(w,z)

#
import bisect
N, M = map(int, input().split())
city = []
table = [0]*M
count = [0]*M
for i in range(M):
  P, Y = map(int, input().split())
  P -= 1
  city.append((i,P,Y))
city.sort(key=lambda x:x[2])
for i, P, Y in city:
  count[P] += 1
  x = str(count[P])
  P = str(P+1)
  ans = P.zfill(6)+x.zfill(6)
  table[i] = ans
for i in range(M):
  print(table[i])

### FIXED CODE ###

N, M = map(int, input().split())
PY = [list(map(int,input().split())) for i in range(M)]
for i in range(M):
  PY[i].append(i)
  
PY.sort(key=lambda x:x[1])
pcount = {i:0 for i in range(1,N+1)}
ID = {i:"" for i in range(1,M+1)}

for i in range(M):
  pcount[PY[i][0]] += 1
  PY[i].append("{:0=6}".format(PY[i][0]) + "{:0=6}".format(pcount[PY[i][0]]))
PY.sort(key=lambda x:x[2])
for i in range(M):
  print(PY[i][3])
import sys
from functools import lru_cache
sys.setrecursionlimit(10**9)
MOD=10**9+7
n,m=map(int,input().split())
a=set([int(input()) for _ in range(m)])
if 1 in a:
  ans=[1,0]
else:
  ans=[1,1]

@lru_cache(maxsize=None)
def cnt(x):
  if x<2:
    return ans[x]
  if x in a:
    return 0
  else:
    return (cnt(x-1)+cnt(x-2))%MOD

print(cnt(n))

### FIXED CODE ###

MOD=10**9+7
N,K=map(int,input().split())
A=list(map(int,input().split()))
ans=0
for i in range(N-1):
  for j in range(i+1,N):
    if A[i]>A[j]:
      ans+=((K+1)*K//2)%MOD
    elif A[i]<A[j]:
      ans+=(K*(K-1)//2)%MOD

print(ans%MOD)
N,M=map(int,input().split())
X=list(map(int,input().split()))
s=[]
sum=0
if M!=1:
    X.sort()
    for i in range(M-1):
        s.append(X[i+1]-X[i])
    t=[]
    for i in range(M-1):
        t.append(s[i])
    s.sort(reverse=True)
    buf=[[],[]]
    for i in range(N-1):
        buf[0].append(s[i])
        buf[1].append(t.index(s[i]))
    print(buf)
    buf[1].sort()
    for i in range(len(buf[1])):
        if i==0:
            sum+=X[buf[1][i]]-X[0]
        else:
            sum+=X[buf[1][i]]-X[buf[1][i-1]+1]
    sum+=X[M-1]-X[buf[1][-1]+1]
else:
    sum=0
    print(sum)



### FIXED CODE ###

N,M=map(int,input().split())
X=list(map(int,input().split()))
X.sort()
a=[0 for i in range(M-1)]
for i in range(M-1):
    a[i]=X[i+1]-X[i]
a.sort(reverse=True)
a=a[N-1:]
print(sum(a))
N = int(input())
A =list(map(int,input()))
A.sort()
for i in range(N-1):
    if A[i] == A[i+1]:
        print('NO')
        exit()
print('YES')
    

### FIXED CODE ###

N = int(input())
A =list(map(int,input().split()))
A.sort()
for i in range(N-1):
    if A[i] == A[i+1]:
        print('NO')
        exit()
print('YES')
n,m=map(int,input().split())
a=(1,3,5,7,8,10,12)
b=(4,6,9,11)
c=(2)
flag=False
if n in a and m in a:
  flag=True
  print("Yes")
elif n in b and m in b:
  flag=True
  print("Yes")
elif n in c and m in c:
  flag=True
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n,m=map(int,input().split())
a=(1,3,5,7,8,10,12)
b=(4,6,9,11)
c=(2,)
if n in a and m in a:
  print("Yes")
elif n in b and m in b:
  print("Yes")
elif n in c and m in c:
  print("Yes")
else:
  print("No")
import sys
import math
input = sys.stdin.readline


def main():
    A, B = map(int, input().split())
    for i in range(10000):
        if math.floor((i+1) * 0.08) == A and math.floor((i+1) * 0.1) == B:
            print(i+1)
            exit(-1)
    print("-1")


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import math
input = sys.stdin.readline


def main():
    A, B = map(int, input().split())
    for i in range(1000):
        if math.floor((i+1) * 0.08) == A and math.floor((i+1) * 0.1) == B:
            print(i+1)
            exit()
    print("-1")


if __name__ == '__main__':
    main()
a,b,c,d,e=map(int,input().split()))
if(a==0):
    print(1)
if(b==0):
    print(2)
if(c==0):
    print(3)
if(d==0):
    print(4)
if(e==0):
    print(5)

### FIXED CODE ###

a,b,c,d,e=map(int,input().split())
if(a==0):
    print(1)
if(b==0):
    print(2)
if(c==0):
    print(3)
if(d==0):
    print(4)
if(e==0):
    print(5)
a = input()
b = input()
c = input()
x = input()
z = 0
number = 0
for i in range(a+1):
    for g in range(b+1):
        for h in range(c+1):
            z = 500*i + 100*g + 50*h
            if x == z:
                number += 1

print(number)
                

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
x = int(input())
z = 0
number = 0
for i in range(a+1):
    for g in range(b+1):
        for h in range(c+1):
            z = 500*i + 100*g + 50*h
            if x == z:
                number += 1

print(number)
import sys

def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 10**5//1
    for x in list1 :
        do = T - x * 0.006
        dosi.append(do)
    #print(dosi)
    
    for y in dosi :
        ti = A - y
        titen.append(ti)
    #print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    #print(titen1)
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)

def main():
    print(solve(*readQuestion()))

# Uncomment before submission
 main()

### FIXED CODE ###

import sys
 
def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 10**5//1
    for x in ls_H :
        do = T - x * 0.006
        dosi.append(do)
    #print(dosi)
    
    for y in dosi :
        til = A - y
        titen.append(til)
    #print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    #print(titen1)
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1
 
def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)
 
def main():
    print(solve(*readQuestion()))
 # Uncomment before submission
main()
s=input()
if(s-"2019/04/30" >0):
   print("TBD")
else:
   print("Heisei")

### FIXED CODE ###

s=input()
if(s>"2019/04/30"):
   print("TBD")
else:
   print("Heisei")
s = list(input())
if s[0] == s[1] or s[1] == s[2] or s[2] = s[3]:
  print("Good")
else:
  print("Bad")

### FIXED CODE ###

s = list(input())
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
  print("Bad")
else:
  print("Good")
h, a = map(int, input(), split())
n = 0
while True:
    h = h - a
    n = n + 1
    if h <= 0:
        break
print(n) 

### FIXED CODE ###

h, a = map(int, input(). split())
n = 0
while True:
    h = h - a
    n = n + 1
    if h <= 0:
        break
print(n)
a = int(input(""))
b = float(input(""))

mul = int(a*b)
print(mul)

### FIXED CODE ###

import math
a,b=input().split()
a=int(a)
b= int(b.replace(".",""))
print(a*b//100)
N, *A = open(0).read().split()

S = [[0] * 21 for _ in range(21)]

ans = 0
for a in A:
    if (idx := a.find(".")) == -1:
        c2 = c5 = 0
    else:
        c2 = c5 = -(len(a) - idx - 1)

    a = int(a.replace(".", ""))
    while a % 2 == 0:
        c2 += 1
        a //= 2
    while a % 5 == 0:
        c5 += 1
        a //= 5
    c2 = min(c2, 10)
    c5 = min(c5, 10)
    ans += sum(S[i][j] for i in range(10 - c2, 21) for j in range(10 - c5, 21))

    S[c2 + 10][c5 + 10] += 1

print(ans)

### FIXED CODE ###

N, *A = open(0).read().split()

S = [[0] * 21 for _ in range(21)]

ans = 0
for a in A:
    idx = a.find(".")
    if idx == -1:
        c2 = c5 = 0
    else:
        c2 = c5 = -(len(a) - idx - 1)

    a = int(a.replace(".", ""))
    while a % 2 == 0:
        c2 += 1
        a //= 2
    while a % 5 == 0:
        c5 += 1
        a //= 5
    c2 = min(c2, 10)
    c5 = min(c5, 10)
    ans += sum(S[i][j] for i in range(10 - c2, 21) for j in range(10 - c5, 21))

    S[c2 + 10][c5 + 10] += 1

print(ans)
from math import log2

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

def bitpos(x,digit=1):
  bit = x % (2**digit) // (2**(digit-1))
  pos = x % (2**digit)
  return int(bit),pos

max_digit=int(log2(B))+1

xor=[]
for i in range(max_digit):
  abit,apos = bitpos(A,i+1)
  bbit,bpos = bitpos(B,i+1)
  if i == 0:
    ar,br = A%4,B%4
    if (ar,br) in {(0,1),(0,2),(1,1),(1,2),(2,3),(2,0),(3,3),(3,0)}:
      xor.append('1')
      continue
    else:
      xor.append('0')
      continue
  
  if abit == 0 and bbit==0:
    xor.append('0')
    continue
  elif abit == 1 and bbit==0:
    if apos % 2 == 1:
      xor.append('1')
      continue
    else:
      xor.append('0')
      continue
  elif abit == 0 and bbit == 1:
    if bpos % 2 == 0:
      xor.append('1')
      continue
    else:
      xor.append('0')
      continue
  else:
    if abs(apos-bpos) % 2 == 1:
      xor.append('0')
      continue
    else:
      xor.append('1')
      continue
xor = xor[::-1]
print(int(''.join(xor),2))

### FIXED CODE ###

from math import log2

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

def bitpos(x,digit=1):
  bit = x % (2**digit) // (2**(digit-1))
  pos = x % (2**digit)
  return int(bit),pos

if B == 0:
  print(0)
  exit()
else:
  max_digit=int(log2(B))+1

xor=[]
for i in range(max_digit):
  abit,apos = bitpos(A,i+1)
  bbit,bpos = bitpos(B,i+1)
  if i == 0:
    ar,br = A%4,B%4
    if (ar,br) in {(0,1),(0,2),(1,1),(1,2),(2,3),(2,0),(3,3),(3,0)}:
      xor.append('1')
      continue
    else:
      xor.append('0')
      continue
  
  if abit == 0 and bbit==0:
    xor.append('0')
    continue
  elif abit == 1 and bbit==0:
    if apos % 2 == 1:
      xor.append('1')
      continue
    else:
      xor.append('0')
      continue
  elif abit == 0 and bbit == 1:
    if bpos % 2 == 0:
      xor.append('1')
      continue
    else:
      xor.append('0')
      continue
  else:
    if abs(apos-bpos) % 2 == 1:
      xor.append('0')
      continue
    else:
      xor.append('1')
      continue
xor = xor[::-1]
print(int(''.join(xor),2))
import numpy as np
import sys
input = sys.stdin.readline

n = int(input())
a = list(map(int,input().split()))
ans = 1

for i in a:
    ans = ans*i
    if ans > 1000000000000000000:
        ans = -1
        exit
    elif ans == 0:
        exit

print(ans)

### FIXED CODE ###

import numpy as np
import sys
input = sys.stdin.readline
 
n = int(input())
a = list(map(int,input().split()))
ans = 1

for i in a:
    ans *= i
    if ans > 10**18:
        ans = -1
        break
 
if 0 in a:
    ans = 0

print(ans)
A = int(input())
B = int(input())
socket = 0
count = 0
if B==1 :
    count=0
elif i != 0 :
    while socket < B :
        if socket + A < B :
            socket = socket + A - 1
            count += 1
        elif socket+A >= B :
            socket = socket + A
            count += 1
print(count)


### FIXED CODE ###

a,b=map(int,input().split())
now=a
i=1
if b>1:
    while now<b:
        now+=a-1
        i+=1
    print(i)
else:
    print(0)
prices = list(map(int,input().split()))
price.sort()
return(price[0]+price[1])

### FIXED CODE ###

prices = list(map(int,input().split()))
prices.sort()
print(prices[0]+prices[1])
from sympy import factorint
n=int(input())
A=list(map(int,input().split(' ')))
ans = []
for i in A:
    tmp = factorint(i)
    ans.append(tmp[2])
print(min(ans))

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split(' ')))
ans = []
for i in A:
    tmp = 0
    while i%2==0:
        tmp += 1
        i/=2
    ans.append(tmp)
print(min(ans))
import bisect
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
t = S()

for i in range(len(s)-len(t),-1,-1):
	cnt = 0
	for j in range(i,i+len(t)-1):
		if s[j] == t[j-i] or s[j] == "?":
			cnt += 1
			continue
		else:
			break
	if cnt == len(t)-1:
		print(s.translate(str.maketrans({'?':'a'}))[:A]+t+s.translate(str.maketrans({'?':'a'}))[A+len(t)-1:])
		exit()

print("UNRESTORABLE")

### FIXED CODE ###

import bisect
import numpy as np
import sys

def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
t = S()

f = 0
for i in range(len(s)-len(t),-1,-1):
    for j in range(len(t)):
        if s[i+j] == t[j] or s[i+j] == "?":
            continue
        else:
            break
    else:
        a = s[:i]+t+s[i+len(t):]
        print(a.replace('?', 'a'))
        break
else:
    print("UNRESTORABLE")
n=input()
num=len(n)-1

for i in range(2**num):
    l=['-']*num
    for j in range(num):
        if (i >> j) & 1:
            l[num-1-j]='+'

    formula=""
    for l_num, l_m in zip(n,l+""):
        formula += l_num + l_m
    
    if eval(formula)==7
        print(formula"=7")
        break



### FIXED CODE ###

def dfs(i, Str, res):
    if i==3:
        if res==7:
            print(Str+"=7")
            exit()
        return
    
    dfs(i+1,Str+"+"+s[i+1],res+int(s[i+1]))
    dfs(i+1,Str+"-"+s[i+1],res-int(s[i+1]))

s=input()
dfs(0,s[0],int(s[0]))
def pal(s):
  f = True;
  i = 0;
  l = s.size() - 1;
  while i < l - i:
    if s[i] != s[l - i]:
      f = false;
	i++;
  return f;

s = input();
f = pal(s) and pal(s[0:(n//2 - 1):]) and pal(s[(n//2 + 1)::]);
if f == True:
  print("Yes");
else:
  print("No");

### FIXED CODE ###

def pal(t):
  return t == t[::-1];


s = input();
f = pal(s) and pal(s[0:len(s)//2:]) and pal(s[(len(s)//2 + 1)::]);
#f = pal(s);
if f == True:
  print("Yes");
else:
  print("No");
H, N = input().split()
H = int(H)
#print(H)
#H, N = input().split()
lis = list(map(int,input().split()))
A =sum(lis)
if H > A:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

H,A = map(int, input().split())
num = 0
while H >0:
  num += 1
  H -= A
print(num)
from math import factorial

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

def comb(n,r):
    return factorial(n) / (factorial(r) * factorial(n-r))

for i in range(1,k+1):
    if i > n-k+1:
        print(0)
    else:
        x = comb(k-1,i-1) % mod
        y = comb(n-k+1,n-k-i+1)
        print(int(x*y) % mod)


### FIXED CODE ###

from math import factorial

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

def cmb(n,r):
    return factorial(n) // (factorial(r) * factorial(n-r))

for i in range(1,k+1):
    if n-k+1 < i or k-1 < i-1:
        print(0)
    else:
        x = cmb(k-1,i-1) % mod
        y = cmb(n-k+1,i) % mod
        ans = (x*y) % mod
        print(int(ans))
import sys
for s in sys.stdin.readlines():
    L=[]
    for d in s:
        if d=="-":
            L.append(-(L.pop()-L.pop()))
        elif d=="+":
            L.append(L.pop()+L.pop())
        elif d=="*":
            L.append(L.pop()*L.pop())
        elif d=="/":
            L.append(1/L.pop()*L.pop())
        L.append(float(d))
    print L[0]

### FIXED CODE ###

import sys
for s in sys.stdin.readlines():
    L=[]
    for d in s.strip().split():
        if d=="-":
            d=(-(L.pop()-L.pop()))
        elif d=="+":
            d=(L.pop()+L.pop())
        elif d=="*":
            d=(L.pop()*L.pop())
        elif d=="/":
            d=(1/L.pop()*L.pop())
        L.append(float(d))
    print "%.6f"%L[0]
n, a, b = map(lambda x: x, input().split())

if n*a < b:
  print(n*a)
else:
  print(b)

### FIXED CODE ###

n, a, b = map(lambda x: int(x), input().split())

if n*a < b:
  print(n*a)
else:
  print(b)
x,y=list(map(int,input().split()))

for i in range(x+1):
  if i*2+(x-i)*4 == y:
    print("Yes")
    exit()
    
print("No")

### FIXED CODE ###

A=list(map(int,input().split()))
for i in range(len(A)):
  if A[i] == 0:
    print(i+1)
    break
from collections import deque

H, W = map(int, input().split())
c = [list(input()) for _ in range(H)]

dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]

ans = 0
for i in range(H):
    for j in range(W):
        if c[i][j] == '.':
            sx, sy = (j, i)
            s = [[-1] * W for _ in range(H)]
            d = [[0] * W for _ in range(H)]

            que = deque([])
            que.append((sx, sy))
            s[sy][sx] = 1
            
            while que:
                x, y = que.popleft()
                s[y][x] = 1

                for k in range(4):
                    nx = x + dx[k]
                    ny = y + dy[k]

                    if 0 <= nx < W and 0 <= ny < H and s[ny][nx] != 1 and c[ny][nx] == '.':
                        que.append((nx, ny))
                        d[ny][nx] = d[y][x] + 1
        ans = max(ans, max([max(v) for v in d]))

print(ans)


### FIXED CODE ###

from collections import deque

H, W = map(int, input().split())
c = [list(input()) for _ in range(H)]

dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]

def bfs(sx, sy):
    d = [[-1] * W for _ in range(H)]

    que = deque([])
    que.append((sx, sy))
    d[sy][sx] = 0

    res = 0
    while que:
        x, y = que.popleft()

        for k in range(4):
            nx = x + dx[k]
            ny = y + dy[k]

            if 0 <= nx < W and 0 <= ny < H and d[ny][nx] == -1 and c[ny][nx] == '.':
                que.append((nx, ny))
                tmp = d[y][x] + 1
                d[ny][nx] = tmp
                res = max(res, tmp)

    return res

ans = 0
for i in range(H):
    for j in range(W):
        if c[i][j] == '.':
            tmp = bfs(j, i)
            ans = max(ans, tmp)

print(ans)
import copy
import math
import time
import statistics
import math
import itertools
import bisect
from decimal import *

# a = get_int()
def get_int():
    return int(input())
# a = get_string()
def get_string():
    return input()
# a_list = get_int_list()
def get_int_list():
    return [int(x) for x in input().split()]
# a_list = get_string_list():
def get_string_list():
    return input().split()
# a, b = get_int_multi()
def get_int_multi():
    return map(int, input().split())
# a_list = get_string_char_list()
def get_string_char_list():
    return list(str(input()))
# print("{} {}".format(a, b))
# for num in range(0, a):
# a_list[idx]
# a_list = [0] * a
'''
while (idx < n) and ():

    idx += 1
'''

def main():

    start = time.time()

    n, q = get_int_multi()

    a = [[] for _ in range(n+1)]
    for _ in range(n-1):
        s, e = get_int_multi()
        a[s].append(e)
        a[e].append(s)

    point = [0] * (n+1)
    for _ in range(q):
        p, x = get_int_multi()
        point[p] += x

    def tasu(now, prev):
        for next in a[now]:
            if next == prev:
                continue
            point[next] += point[now]
            tasu(next, now)

    tasu(1, -1)
    point = point[1:] #１つ目は0なので除去（inputは1始まりなので、0は使わない）
    print(*point) # * は引数展開　listの中身を引数にする。例えばprint(*[1,2,3])はprint(1,2,3)になり 1 2 3 が出力される


if __name__ == '__main__':
    main()




### FIXED CODE ###

import copy
import math
import time
import statistics
import math
import itertools
import bisect
import sys
from decimal import *

# a = get_int()
def get_int():
    return int(input())
# a = get_string()
def get_string():
    return input()
# a_list = get_int_list()
def get_int_list():
    return [int(x) for x in input().split()]
# a_list = get_string_list():
def get_string_list():
    return input().split()
# a, b = get_int_multi()
def get_int_multi():
    return map(int, input().split())
# a_list = get_string_char_list()
def get_string_char_list():
    return list(str(input()))
# print("{} {}".format(a, b))
# for num in range(0, a):
# a_list[idx]
# a_list = [0] * a
'''
while (idx < n) and ():

    idx += 1
'''

def main():

    start = time.time()

    n, q = get_int_multi()

    a = [[] for _ in range(n+1)]
    for _ in range(n-1):
        s, e = get_int_multi()
        a[s].append(e)
        a[e].append(s)

    point = [0] * (n+1)
    for _ in range(q):
        p, x = get_int_multi()
        point[p] += x

    def tasu(now, prev):
        for next in a[now]:
            if next == prev:
                continue
            point[next] += point[now]
            tasu(next, now)

    sys.setrecursionlimit(10 ** 6)
    tasu(1, -1)
    point = point[1:] #１つ目は0なので除去（inputは1始まりなので、0は使わない）
    print(*point) # * は引数展開　listの中身を引数にする。例えばprint(*[1,2,3])はprint(1,2,3)になり 1 2 3 が出力される


if __name__ == '__main__':
    main()
a = input()
if a == 'A': print('T')
elif a == 'T':print('A')
else a == 'C': print('G')
else:print('C')

### FIXED CODE ###

a = input()
if a == 'A': print('T')
elif a == 'T':print('A')
elif a == 'C': print('G')
else:print('C')
import math

  
x1 = 0
y1 = 0
x2 = 100
y2 = 0
  
def koch curve(i, n, x1, y1, x2, y2):
    x = [0] * 5
    y = [0] * 5
    if i < n:
        x[0] = x1
        y[0] = y1
        x[1] = (2 * x1 + x2) / 3.0
        y[1] = (2 * y1 + y2) / 3.0
        x[2] = (x1 + 2 * x2) / 3.0
        y[2] = (y1 + 2 * y2) / 3.0
        x[3] = (x[2] - x[1]) * math.cos(math.pi/3) - (x[2] - x[1]) * math.sin(math.pi/3) + x[1]
        y[3] = (y[2] - y[1]) * math.cos(math.pi/3) + (y[2] - y[1]) * math.sin(math.pi/3) + y[1]
        x[4] = x2
        y[4] = y2
        koch_curve(i+1, n, x[0], y[0], x[1], y[1])
        print x[1], y[1]
        koch_curve(i+1, n, x[1], y[1], x[3], y[3])
        print x[3], y[3]
        koch_curve(i+1, n, x[3], y[3], x[2], y[2])
        print x[2], y[2]
        koch_curve(i+1, n, x[2], y[2], x[4], y[4])
n = input()  
print x1 y1
koch_curve(0, n, x1, y1, x2,y2)
print x2, y2

### FIXED CODE ###


 
import math

 
def koch_curve(i, n, x1, y1, x2, y2):
    x = [0]*5
    y = [0]*5
    if i < n:
        x[0] = x1
        y[0] = y1
        x[1] = (2*x1+x2)/3.0
        y[1] = (2*y1+y2)/3.0
        x[2] = (x1+2*x2)/3.0
        y[2] = (y1+2*y2)/3.0
        x[3] = (x[2] - x[1])*math.cos(math.pi/3) - (y[2] - y[1])*math.sin(math.pi/3) + x[1]
        y[3] = (y[2] - y[1])*math.cos(math.pi/3) + (x[2] - x[1])*math.sin(math.pi/3) + y[1]
        x[4] = x2
        y[4] = y2
        koch_curve(i+1, n, x[0], y[0], x[1], y[1])
        print x[1], y[1]
        koch_curve(i+1, n, x[1], y[1], x[3], y[3])
        print x[3], y[3]
        koch_curve(i+1, n, x[3], y[3], x[2], y[2])
        print x[2], y[2]
        koch_curve(i+1, n, x[2], y[2], x[4], y[4])
        
n = int(input())
 
x1 = 0
y1 = 0
x2 = 100
y2 = 0 
print x1, y1
koch_curve(0, n, x1, y1, x2, y2)
print x2, y2
import numpy as np
a,b,m = [int(i) for i in input().split()]
aa = [int(i) for i in input().split()]
bb = [int(i) for i in input().split()]
x = np.zeros(m,dtype=int)
y = np.zeros(m,dtype=int)
c = np.zeros(m,dtype=int)
for i in range(m):
    x[i],y[i],c[i] = [int(j) for j in input().split()]
r = np.zeros((a,b),dtype=int)
for i in range(a):
    for j in range(b):
        r[i][j] = aa[i] + bb[j]
v = np.min(r)
for i,j,l in zip(x,y,c):
    if v > r[i-1][j-1] - l:
        v = r[i-1][j-1] - l
print(v)

### FIXED CODE ###

s = input()
if s.replace('hi','') == '':
    print('Yes')
else:
    print('No')
n = int(input())
a_list = list(map(int, input().split()))
num = a_list[0]

for i in range(n):
    num = math.gcd(num, a_list[i])
print(num)

### FIXED CODE ###

import fractions
n = int(input())
a_list = list(map(int, input().split()))
num = a_list[0]

for i in range(n):
    num = fractions.gcd(num, a_list[i])
print(num)