Harryxun/stf_run huggingface dataset:
from heapq import heappush, heappop

INF =  10000000000

def dijkstra(r, v, dic):
    dp = []
    q = []
    dp = [INF] * v
    dp[r] = 0
    heappush(q, (0, r))
    while q:
        cost, vtx = heappop(q)
        if dp[vtx] < cost:
            continue
        for vtx1, cost1 in dic[vtx]:
            if cost + cost1 < dp[vtx1]:
                dp[vtx1] = cost + cost1
                heappush(q, (cost + cost1, vtx1))
    return dp

dp = []
line = input()
n = int(line)
edge = {}
for _ in range(0, n - 1):
    line = input()
    s, t, d = list(map(int, line.split()))
    if s not in edge:
        edge[s] = [[t, d]]
    else:
        edge[s] += [[t, d]]
    if t not in edge:
        edge[t] = [[s, d]]
    else:
        edge[t] += [[s, d]]
diam = []
dp = dijkstra(0, n, edge)
i = [j for j, x in enumerate(dp) if x == max(dp)]
dp = dijkstra(i[0], n, edge)
diam = max(dp[i] if dp[i] != INF else 0 for i in range(0, n))
print(diam)


### FIXED CODE ###

def solve(prev, r, dic):
    d = 0
    t = r
    stack = []
    stack += [[prev, r, d]]
    while stack:
        prev, r, d1 = stack.pop(-1)
        if r in dic:
            for vtx, cost in dic[r]:
                if vtx == prev:
                    continue
                stack += [[r, vtx, d1 + cost]]
                if d < d1 + cost:
                    d = d1 + cost
                    t = vtx
    return d, t

line = input()
n = int(line)
edge = {}
for _ in range(0, n - 1):
    line = input()
    s, t, d = list(map(int, line.split()))
    if s not in edge:
        edge[s] = [[t, d]]
    else:
        edge[s] += [[t, d]]
    if t not in edge:
        edge[t] = [[s, d]]
    else:
        edge[t] += [[s, d]]
r1, t1 = solve(-1, 0, edge)
r2, t2 = solve(-1, t1, edge)
print(r2)
H,W = map(int, input().split())
List = []
queue = [(0,0,1)]
shape = 0
used ={(0,0)}
for i in range(H):
    x = input()
    shape += x.count('#')
    List.append(x)

def check(x,y,c):
    if(x > W-1 or y > H-1):
        return
    if(List[y][x] == '#'):
        return
    if(x,y) in used:
        return
    queue.append((x,y,c+1))
    used.add((x,y))

flag = -1
while(len(queue) != 0):
    x,y,c = queue[0]
    if x==W-1 and y==H-1:
        flag = 1
        break
    queue.pop(0)
    check(x+1,y,c)
    check(x, y+1,c)
    check(x-1,y,c)
    check(x, y-1,c)
if(flag == 1):
    print(H*W - c - shape)
else:
    print(-1)

### FIXED CODE ###

H,W = map(int, input().split())
List = []
queue = [(0,0,1)]
shape = 0
used ={(0,0)}
for i in range(H):
    x = input()
    shape += x.count('#')
    List.append(x)

def check(x,y,c):
    if(x>W-1 or y>H-1 or x<0 or y<0):
        return
    if(List[y][x] == '#'):
        return
    if(x,y) in used:
        return
    queue.append((x,y,c+1))
    used.add((x,y))

flag = -1
while(len(queue) != 0):
    x,y,c = queue[0]
    if x==W-1 and y==H-1:
        flag = 1
        break
    queue.pop(0)
    check(x+1,y,c)
    check(x, y+1,c)
    check(x-1,y,c)
    check(x, y-1,c)
if(flag == 1):
    print(H*W - c - shape)
else:
    print(-1)
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > > 
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);


    
    string s;
    cin >> s ;
    cout << 700 + 100 * count(all(s), 'o') << endl;

    
  
    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


### FIXED CODE ###

s = raw_input()
print 700+s.count('o')*100
x, n = map(int, input().split())
listP = list(map(int, input().split()))

listP.sort()

minD = 200
val = 0
bef = None
for p in listP:
    if bef == None:
        bef = p
    else:
        if p-1 == bef:
            pass
        else:
            if bef < x < p:
                minD = 0
                val = x
            elif x <= bef:
                if abs(bef+1-x) < minD:
                    minD = abs(bef+1-x)
                    val = bef+1
            else:
                if abs(p-1-x) < minD:
                    minD = abs(p-1-x)
                    val = p-1
        bef = p
if abs(bef+1-x) < minD:
    val = bef+1
elif not x in listP:
    val = x
elif val == 0:
    if abs(0-x) > abs(101-x):
        val = 101
    else:
        val = 0

print(val)

### FIXED CODE ###

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

listP.sort()

minD = 200
val = 0
bef = None
for p in listP:
    if bef == None:
        bef = p
        minD = abs(p-1-x)
        val = p-1
    else:
        if p-1 == bef:
            pass
        else:
            if bef < x < p:
                minD = 0
                val = x
            elif x <= bef:
                if abs(bef+1-x) < minD:
                    minD = abs(bef+1-x)
                    val = bef+1
            else:
                if abs(p-1-x) < minD:
                    minD = abs(p-1-x)
                    val = p-1
        bef = p
if not x in listP:
    val = x
    minD = 0
elif val == 0:
    if abs(0-x) > abs(101-x):
        val = 101
        minD = abs(101-x)
    else:
        val = 0
        minD = abs(0-x)
elif bef!=None and abs(bef+1-x) < minD:
    val = bef+1

print(val)
list = map(int,raw_input().split())
ilst.sort()
print'%d %d %d' % (list[0],list[1],list[2])     

### FIXED CODE ###

list = map(int,raw_input().split())
list.sort()
print'%d %d %d' %(list[0],list[1],list[2])
n, r = map(int,input().split())

if n >= 10:
    print(r)
else:
    r += 100*(10-n)
    print(r)2

### FIXED CODE ###

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

if n >= 10:
    print(r)
else:
    r += 100*(10-n)
    print(r)
S=input()
N=len(S)
s=0
if N%2==0:
  for i in range(0,N//2+1):
    if S[i]!=S[N-1-i]:
      S[N-1-i]=S[i]
      s+=1
  print(s)
else:
  for i in range(0,N//2):
    if S[i]!=S[N-1-i]:
      S[N-1-i]=S[i]
      s+=1
  print(s)


### FIXED CODE ###

def main():
  S=input()
  s=0
  N=len(S)
  for i in range(N//2):
    if S[i]!=S[N-1-i]:
      s+=1
  print(s)
main()
import math
i=float(raw_input())
print "%.6f %.6f" % (i*i*math.pi,2*i*math.pi)

### FIXED CODE ###

import math
i=float(raw_input())
print "%.6f %.6f" % (i*i*math.pi,2*i*math.pi)
# -*- coding: utf-8 -*-

from collections import deque

if __name__ == '__main__':
    n = int(input())
    L = deque()

    for _ in range(n):
        command = input().split(" ")
        if command[0] == "insert":
            L.appendleft(command[1])
        elif command[0] == "delete":
            L.remove(command[1])
        elif command[0] == "deleteFirst":
            L.popleft()
        elif command[0] == "deleteLast":
            L.pop()

    print(" ".join(L))



### FIXED CODE ###

# -*- coding: utf-8 -*-

from collections import deque

if __name__ == '__main__':
    n = int(input())
    L = deque()

    for _ in range(n):
        command = input().split(" ")
        if command[0] == "insert":
            L.appendleft(command[1])
        elif command[0] == "delete":
            try:
                L.remove(command[1])
            except:
                pass
        elif command[0] == "deleteFirst":
            L.popleft()
        elif command[0] == "deleteLast":
            L.pop()

    print(" ".join(L))
from itertools import*
n=int(input())
s=input()
t=[len(list(v)) for k,v in groupby(s)]
r=s.count("#")
l=0
ans=[r,s.count(".")]

if s[0]=="#":
    for i in range(0,len(t)//2+1,2):
        r-=t[i+1]
        l+=t[i]
        ans.append(r+l)
else:
    for i in range(1,len(t)//2+1,2):
        r-=t[i+1]
        l+=t[i]
        ans.append(r+l)
print(min(ans))

### FIXED CODE ###

n=int(input())
s=input()
r=s.count(".")
ans=[r]
for i in s:
    if i=="#":
        r+=1
    else:
        r-=1
    ans.append(r)
print(min(ans))
n = int(input())
a = list(map(int, input()))
a.sort(reverse=True)
ans = 0
for i in range(N):
    if a[i] % 2 == 0:
        ans += a[i]
    else:
        ans -= a[i]

print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = 0
for i in range(n):
    if i % 2 == 0:
        ans += a[i]
    else:
        ans -= a[i]

print(ans)
n=int(input())
def ceil(a,b):
    ret = -(-a//b)
    if ret%2==0:
        return ret
    else:
        return ret+1

print(0)
first=input()
if first=="Vacant":
    exit()

l=0
r=n

while abs(l-r)>5:
    nxt = ceil(l+r,2)
    print("l==",l,"r==",r)
    print(nxt)
    ans=input()
    if ans=="Vacant":
        exit()
    if ans==first:
        l=nxt
    else:
        r=nxt


for i in range(l,r):
    print(i)
    ans=input()
    if ans=="Vacant":
        exit()

### FIXED CODE ###

n=int(input())
def ceil(a,b):
    ret = -(-a//b)
    if ret%2==0:
        return ret
    else:
        return ret+1

print(0)
first=input()
if first=="Vacant":
    exit()

l=0
r=n

while abs(l-r)>5:
    nxt = ceil(l+r,2)
    print(nxt)
    ans=input()
    if ans=="Vacant":
        exit()
    if ans==first:
        l=nxt
    else:
        r=nxt


for i in range(l,r):
    print(i)
    ans=input()
    if ans=="Vacant":
        exit()
a = []
i = 0

s = int(input())

a.append(s)

while True:
    if(a[i] % 2 == 0):
        if(a[i] / 2 != 0):
        	ans = int(a[i] / 2)
        else:
            ans = 0
        if ans in a:
            print(str(i + 2))
            break
       	a.append(ans)
    else:
        anss = int(a[i] * 3 + 1)
        if anss in a:
            print(str(i + 2))
            break
        a.append(anss)

    i += 1

### FIXED CODE ###

AB, BC, CA = map(int, input().split())

a = int(AB * BC / 2)

print(str(a))
import math
n=int(input())
A=list(map(int,input().split()))
gd=1
tmp=A[0]
for i in range(n-1):
    gd=math.gcd(A[i+1],A[i])
    tmp*=A[i+1]
lcm=tmp//gd
lcm-=1
ans=0
for a in A:
    ans+=lcm%a

print(ans)

### FIXED CODE ###

import fractions
n=int(input())
A=list(map(int,input().split()))
gd=1
tmp=A[0]
for i in range(n-1):
    gd=fractions.gcd(A[i+1],A[i])
    tmp*=A[i+1]
lcm=tmp//gd
lcm-=1
ans=0
for a in A:
    ans+=lcm%a

print(ans)
H, W = map(int, input().split())
def sc(s):
    b = None
    nc = 0
    kk = [0]*len(s)
    for i, c in enumerate(s):
        if c == ".":
            if c == b:
                nc += 1
            else:
                si = i
        else:
            if b == ".":
                for j in range(si, i):
                    kk[j] = i - si
            nc = 0
        b = c
    return kk
d = []
d2 = []
d3 = []
for h in range(H):
    s = input().strip() + "#"
    d.append(s)
    d2.append(sc(s))

for i in range(W):
    s = ""
    for j in range(H):
        s += d[j][i]
    s += "#"
    d3.append(sc(s))
r = 0
for i in range(H):
    for j in range(W):
        r = max(r, d2[i][j] + d3[j][i]-1)
print(r)


### FIXED CODE ###

import sys
L, A, B, M = map(int, input().split())
mod = M
sys.setrecursionlimit(pow(10, 8))

def power(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y//2)**2 % mod
    else            : return power(x, (y-1)//2)**2 * x % mod
def mul(a, b):
    return ((a % mod) * (b % mod)) % mod
def modinv(a):
    b, u, v = mod, 1, 0
    while b:
        t = a//b
        a, u = a-t*b, u-t*v
        a, b, u, v = b, a, v, u
    u %= mod
    return u
def div(a, b):
    return a * modinv(b) % mod

def G(n, i):
    if n == 1:
        return 1
    tn = n//2
    return (G(tn, i) * (1 + power(10, tn*i)) %mod + (n%2)*power(10, (n-1)*i)) % mod

def G2(n, i):
    if n ==0 :
        return 0
    if n == 1:
        return power(10, i) % mod
    tn = n//2
    X = G2(tn, i)
    I = power(10, tn*i)
    Y = (X*(I+1)%mod + mul(mul(tn, I), (G(tn+1, i)-1))%mod) %mod
    Y = Y + mul(n%2, mul(n, power(10, n*i)))
    return Y%mod


def f(a, b, n, i):
    if n == 0:
        return 0
    r = power(10, i)
    P = power(r,n)
    #aa = mul(a, div(P-1, r-1))
    aa = mul(a, G(n, i))
    bb2 = mul(b, div(r-n*P + (n-1)*P*r, mul(1-r, 1-r)))
    bb = mul(b, G2(n-1, i))
    #print(n-1, i, div(r-n*P + (n-1)*P*r, mul(1-r, 1-r)), G2(n-1, i))
    #print(bb, bb2)
    return (aa - bb) % mod

sl = A + (L-1) * B
t = 10
k = 0
ts = 0
ks = []
mk = 18
for i in range(mk):
    k = max(min((t-1),sl)-(A-B), 0) // B - ts
    #print(t, min(t, sl) - (A-B), -(-((min(t, sl) - (A-B))//B)))
    #k = -(-(min(t, sl) - (A-B)) // B) - 1 - ts
    ts += k
    ks.append(k)
    t *= 10
ti = 0
ti2 = 0
b = B
R = 0
for i in range(mk):
    i = mk - i
    n = ks[i-1]
    a = sl - ti2*b
    if n:
        R = (R + (f(a, b, n, i))*power(10, ti)) % mod
#        print(a, f(a,b,r,n))
#    print(a, b, r, n, R, ti)

    ti += i*n
    ti2 += n
print(R)
#$print(ks)
import math
import numpy as np
N,M=map(int,input().split())
A=list(map(int,input().split()))
c=0
test=A[0]
l=0

while test%2 == 0:
  test=int(test/2+0.5)
  c+=1
 
for i in np.arange(N-1):
  if A[i+1]%(2**c)!=0:
    print(0)
    l=1
    break
  elif A[i+1]%(2**(c+1))==0:
    print(0)
    l=1
    break
  else:
    test=int(test*int(A[i+1]/(2**c)+0.5)/math.gcd(test,int(A[i+1]/(2**c)+0.5))+0.5)
if l==0:
  print(M//(test*(2**(c-1)))//2 + M//(test*(2**(c-1)))%2)


### FIXED CODE ###

import math
import numpy as np
N,M=map(int,input().split())
A=list(map(int,input().split()))
c=1
test=A[0]
l=0

while test%2 == 0:
  test=test//2
  c*=2

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
  
for i in np.arange(N-1):
  if A[i+1]%c!=0:
    print(0)
    l=1
    break
  elif A[i+1]%(c*2)==0:
    print(0)
    l=1
    break
  else:
    k=A[i+1]//c
    test=lcm_base(test, k)
if l==0:
  k=test*c//2
  print(M//k//2 + M//k%2)
x = raw_input()
print(x ** 3)

### FIXED CODE ###

x = int(raw_input())
print x ** 3
import sys

H,W,M = list(map(int, input().split()))

hw = [[0] * (W+1) for _ in range(H+1)]

w = [0] * (W+1)
h = [0] * (H+1)
mxw = []
mxw_v = 0
mxh = []
mxh_v = 0


for i in range(M):
    h_i, w_j = list(map(int, input().split()))
    hw[h_i][w_j] = 1
    h[h_i] += 1
    w[w_j] += 1
    if mxw_v < w[w_j]:
        mxw_v = w[w_j]
        mxw = [w_j]
    elif mxw_v == w[w_j]:
        mxw.append(w_j)

    if mxh_v < h[h_i]:
        mxh_v = h[h_i]
        mxh = [h_i]
    elif mxh_v == h[h_i]:
        mxh.append(h_i)

a = 0
for i in mxh:
    for j in mxw:
        d = hw[i][j]
        a = max(a, h[i]+w[j]-d)
print(a)


### FIXED CODE ###

H,W,M = list(map(int, input().split()))

hw = set()
w = [0] * 3*10**5
h = [0] * 3*10**5

for i in range(M):
    h_i, w_j = map(int, input().split())
    hw.add((h_i-1) + (w_j-1)*3*10**6)
    h[h_i-1] += 1
    w[w_j-1] += 1

a = 0
d = 1
mxh_v = max(h)
mxw_v = max(w)

x = [i for i,j in enumerate(h) if j == mxh_v]
y = [i for i,j in enumerate(w) if j == mxw_v]

for i in x:
    for j in y:
        if not(i + j*3*10**6 in hw):
            print(mxh_v+mxw_v)
            exit()
print(mxh_v+mxw_v-d)
N = int(input())
D = sorted([int(input()) for _ in range(N)])
if len(D) == 1: print(1)
i,prev = 1,D[0]
while i != (len(D)-1):
    if D[i] == prev: 
        D.pop(i)
    else:
        i +=1
        prev = D[i]
print(len(D))

### FIXED CODE ###

N = int(input())
D = sorted([int(input()) for _ in range(N)])
if len(D) > 1:
    i,prev = 0,None
    while i < (len(D)-1):
        if D[i] == D[i+1]: 
            D.pop(i+1)
        else:
            prev = D[i]
            i +=1
print(len(D))
H, N = map(int, input().split())
x = [list(map(int, input().split())) for n in range(N)]
x = [[tmp[i] for tmp in x] for i in range(len(x[0]))]
A = x[0]
B = x[1]

import sys
sys.setrecursionlimit(max(1000, H*N))

memo = [-1] * (H + 1)
def ibis(H):
    if memo[H] >= 0:
        return memo[H]
    if H <= 0:
        return 0
    mp = []
    for n in range(N):
        mp.append(B[n] + ibis(H - A[n]))
    memo[H] = min(mp)
    return memo[H]

print(ibis(H))

### FIXED CODE ###

H, N = map(int, input().split())
x = [list(map(int, input().split())) for n in range(N)]
x = [[tmp[i] for tmp in x] for i in range(len(x[0]))]
A = x[0]
B = x[1]

def ibis(H, A, B):
    dp = [max(B) * H] * (H + 1)
    dp[0] = 0
    for h in range(H):
        for n in range(N):
            hp = min(h + A[n], H)
            dp[hp] = min(dp[hp], dp[h] + B[n])
    return dp[H]

print(ibis(H, A, B))
import math

N, S = map(int,input().split())
x = list(map(int,input().split()))
x.append(S)
x = sorted(x)
t = x[1]-x[0]

for k in range(N-1):
    t = math.gcd(t,x[k+1]-x[k])

print(t)

### FIXED CODE ###

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

N, S = map(int,input().split())
x = list(map(int,input().split()))
x.append(S)
x = sorted(x)
t = x[1]-x[0]

for k in range(N):
    t = gcd(t,x[k+1]-x[k])

print(t)
n = int(input())
l = list(map(input().split()))

l.sort(reverse = True)

lm = l[0]

del l[0]

if lm < sum(l):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n = int(input())
l = [int(i) for i in input().split()]

l.sort(reverse = True)

if len(l) == n:
  lm = l[0]

  del l[0]

  if int(lm) < sum(l):
    print('Yes')
  else:
    print('No')
else:
  print('No')
N=int(input())
A=list(map(int,input().split()))
L=sorted(A,reverse=True)
if L[0]<sum(L[1:]):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

T,X=map(int,input().split())
print(T/X)
print(1/(1/int(input())+1/int(input())))

### FIXED CODE ###

a=list(map(int,input().split()))
print(1/(1/a[0]+1/a[1]))
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict

#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	H, W = getlist()
	A = []
	for i in range(H):
		a = getlist()
		A.append(a)
	B = []
	for i in range(H):
		b = getlist()
		B.append(b)

	for i in range(H):
		for j in range(W):
			A[i][j] -= B[i][j]

	DP = [[[0] * 12801 for i in range(W)] for j in range(H)]
	DP[0][0][A[0][0] + 6400] = 1
	for i in range(H):
		for j in range(W):
			for k in range(12801):
				if DP[i][j][k] == 1:
					if j < W - 1:
						DP[i][j + 1][k + A[i][j + 1]] = 1
						DP[i][j + 1][k - A[i][j + 1]] = 1
					if i < H - 1:
						DP[i + 1][j][k + A[i + 1][j]] = 1
						DP[i + 1][j][k - A[i + 1][j]] = 1

	ans = 1000000
	for i in range(12801):
		if DP[H - 1][W - 1][i] == 1:
			ans = min(ans, abs(6400 - i))
	print(ans)

if __name__ == '__main__':
	main()

### FIXED CODE ###

import sys; input = sys.stdin.buffer.readline
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	H, W = getlist()
	A = []
	for i in range(H):
		a = getlist()
		A.append(a)
	B = []
	for i in range(H):
		b = getlist()
		B.append(b)

	C = [[None] * W for i in range(H)]
	for i in range(H):
		for j in range(W):
			C[i][j] = abs(A[i][j] - B[i][j])

	# print(C)
	diff = 12800
	DP = [[0] * W for i in range(H)]
	DP[0][0] = (1 << (diff + C[0][0])) | (1 << (diff - C[0][0]))
	for i in range(1, W):
		DP[0][i] = (DP[0][i - 1] << C[0][i]) | (DP[0][i - 1] >> C[0][i])
	for i in range(1, H):
		DP[i][0] = (DP[i - 1][0] << C[i][0]) | (DP[i - 1][0] >> C[i][0])

	for i in range(1, H):
		for j in range(W):
			DP[i][j] |= (DP[i][j - 1] << C[i][j]) | (DP[i][j - 1] >> C[i][j])
			DP[i][j] |= (DP[i - 1][j] << C[i][j]) | (DP[i - 1][j] >> C[i][j])

	ans = INF
	for i in range(25601):
		if DP[-1][-1] & (1 << i) == (1 << i):
			ans = min(ans, abs(diff - i))

	print(ans)

if __name__ == '__main__':
	main()
b = str(input())
if b == "A":
  pritn("T")
elif b == "T":
  print("A")
elif b == "c":
  print("G")
else:
  print("C")

### FIXED CODE ###

b = str(input())
if (b == "A"):
  print("T")
elif (b == "T"):
  print("A")
elif (b == "C"):
  print("G")
elif (b == "G"):
  print("C")
N, M = map(int, input().split())
S = [list(map(int, input().split())) for _ in range(N)]
C = [list(map(int, input().split())) for _ in range(N)]

for s in S:
    minC = 10**10
    idx = 0
    for i, c in enumerate(C):
        d = abs(s[0]-c[0]) + abs(s[1]-c[1])
        if d < minC:
            minC = d
            idx = i + 1
    print(idx)




### FIXED CODE ###

N, M = map(int, input().split())
S = [list(map(int, input().split())) for _ in range(N)]
C = [list(map(int, input().split())) for _ in range(M)]

for s in S:
    minC = 10**10
    idx = 0
    for i, c in enumerate(C):
        d = abs(s[0]-c[0]) + abs(s[1]-c[1])
        if d < minC:
            minC = d
            idx = i + 1
    print(idx)
n=input()
sum=1
f=0
f2=0
for i in range(0,n):
	a=input()
	if  (a==0): 
		f2=1
	sum*=a
	if (sum>1000000000000000000):
		f=1;
}
if (f2==1): 
	print("0\n")
else if(f==1):
	print("-1\n")
else:
	print(sum)
	print("\n")

### FIXED CODE ###

N=int(input())
 
A=list(map(int,input().split()))
 
if 0 in A:
    print(0)
else:
    result=1
    for a in A:
        result=result*a
        if result>10**18:
            result=-1
            break
    print(result)
x = int(input())
y = int(input())
s1 = [1, 3, 5, 7, 8, 10, 12]
s2 = [4, 6, 9, 11]
if x >= 1:
    if x <= 12:
        if y >= 1:
            if y <= 12:
                if x in s1 and y in s1:
                    print("Yes")
                elif x in s2 and y in s2:
                    print("Yes")
                elif x == 2 and y == 2:
                    print("Yes")
                else:
                    print("No")

### FIXED CODE ###

s=input().split();
x=int(s[0])
y=int(s[1])
list1=[2]
list2=[4,6,9,11]
list3=[1,3,5,7,8,10,12]
ans=0;
if((x in list1) and (y in list1)): ans=1
elif((x in list2) and (y in list2)):ans=1
elif((x in list3) and (y in list3)):ans=1
if(ans==1):print("Yes")
else:print("No")
l = list(map(int, input().split()))

    counter5 = 0
    counter7 = 0

    for num in l:
        if num == 5:
            counter5+=1
        
        if num == 7:
            counter7+=1

    if counter5 == 2 and counter7 == 1:
        print("Yes")
    
    else:
        print("No")

### FIXED CODE ###

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

counter5 = 0
counter7 = 0

for num in l:
    if num == 5:
        counter5+=1
    
    if num == 7:
        counter7+=1

if counter5 == 2 and counter7 == 1:
    print("YES")

else:
    print("NO")
arr = input().split()
h=int(arr[0])
w=int(arr[1])

if w%2!=0:
    if h%2!=0:
        ans=(w+1)//2*(h+1)//2+(w-1)//2*(h-1)//2
    else:
        ans=(w+1)//2*h//2+(w-1)//2*h//2
else:
    if h%2!=0:
        ans=w//2*h
print(ans)

### FIXED CODE ###

arr = input().split()
h=int(arr[0])
w=int(arr[1])
 
if w*h%2!=0 and h!=1 and w!=1:
    ans=(w*h+1)//2
elif h==1 or w==1:
    ans=1
else:
    ans=w*h//2
print(ans)
a = list(map(int,input().split()))

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

aaa = sorted([x,y,z], reverse)
print(aaa[0])



### FIXED CODE ###

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

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

if x >= y and x >= z:
  print(x)
elif y >= x and y >= z:
  print(y)
else:
  print(z)
N=int(input())
lis=[]
ans=0
for i in range(N):
	try:
		y=lis.index(input())
	except:
		lis+=[input()]
		ans+=1
print(ans)

### FIXED CODE ###

N=int(input())
lis=[]
ans=0
for i in range(N):
	lis+=[input()]
print(len(set(lis)))