Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    l = list(map(int, lines.pop(0).split(' ')))
    l.sort()
    print(l[2] - l[0])

#
# main
#

# 1. use list instead of stdin
# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    S = lines.pop(0)
    T = lines.pop(0)
    for i in range(len(S)):
        S = S[-1] + S[:-1]
        if S == T:
            print('Yes')
            sys.exit(0)

    print('No')

#
# main
#

# 1. use list instead of stdin

#contents = '''\
#abcdefg
#abcdegg\
#'''
#lines = contents.split('\n')

# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
N, K = map(int, input().split())
V = [int(i) for i in input().split()]
L = [0] * (N+1)
R = [0] * (N+1)
L_m = [[] for _ in range(N+1)]
R_m = [[] for _ in range(N+1)]

for i in range(1, N+1):
    L[i] = L[i-1] + V[i-1]
    R[i] = R[i-1] + V[-i]
    L_m[i] = L_m[i-1].copy()
    R_m[i] = R_m[i-1].copy()
    if V[i-1] < 0:
        L_m[i].append(V[i-1])
    if V[-i] < 0:
        R_m[i].append(V[-i])

ans = 0

for i in range(K+1):
    for l in range(K+1-i):
        r = K - i - l
        if l + r >= N:
            ans = max(ans, R[-1] - sum(R_m[-1]))
            break
        if r < 0:
            break
        M = L_m[l] + R_m[r]
        M.sort()
        if len(M) >= i:
            m = sum(M[:i])
        else:
            m = sum(M)
        a = L[l] + R[r] - m
        ans = max(ans, a)

print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
V = [int(i) for i in input().split()]
L = [0] * (N+1)
R = [0] * (N+1)
L_m = [[] for _ in range(N+1)]
R_m = [[] for _ in range(N+1)]

for i in range(1, N+1):
    L[i] = L[i-1] + V[i-1]
    R[i] = R[i-1] + V[-i]
    L_m[i] = L_m[i-1].copy()
    R_m[i] = R_m[i-1].copy()
    if V[i-1] < 0:
        L_m[i].append(V[i-1])
    if V[-i] < 0:
        R_m[i].append(V[-i])

ans = 0

for i in range(K+1):
    for l in range(K+1-i):
        r = K - i - l
        if l + r >= N:
            ans = max(ans, R[-1] - sum(R_m[-1]))
            break
        if r < 0:
            break
        M = L_m[l] + R_m[r]
        M.sort()
        if len(M) >= i:
            m = sum(M[:i])
        else:
            m = sum(M)
        a = L[l] + R[r] - m
        ans = max(ans, a)

print(ans)
N,K = map(int,input().split())
h = []
for _ in range(N):
    h.append(int(input()))
h = sorted(h)
tmp = 0
loop = N-K+1
for i in range(loop):
    tmp = h[K+i-1] - h[0+i]
    if(tmp < ans):
        ans = tmp
print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
h = []
for _ in range(N):
    h.append(int(input()))
h = sorted(h)
tmp = 0
ans = 10000000000
loop = N-K+1
for i in range(loop):
    tmp = h[K+i-1] - h[0+i]
    if(tmp < ans):
        ans = tmp
print(ans)
n,k =  map(int,input().split())
A = list(map(int,input().split()))

l = min(A)//(k+1) 
r = max(A)
m = (l+r)//2+1

while 1:
    
    m = (l+r)//2
    
    #m以下の長さにできるか判定
    
    # A_long = A[A>m]
    n= sum( [  int((A[i]-0.1)//(m)) for i in range(len(A)) ] )
    
    print(l,m,r,n)
    
    if n<=k:
        if r==m:
            break
        r=m-1
    else:
        if l==m:
            m+=1
            break
        l=m+1
        

        
print(m)

### FIXED CODE ###

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

l = min(A)//(k+1) 
r = max(A)
m = (l+r)//2+1

while 1:
    
    m = (l+r)//2
    if m==0:
        m=1
        break

    
    #m以下の長さにできるか判定
    
    # A_long = A[A>m]
    n= sum( [  int((A[i]-0.1)//(m)) for i in range(len(A)) ] )
    
    # print(l,m,r,n)
    
    if n<=k:
        if r==m:
            break
        r=m-1
    else:
        if l==m:
            m+=1
            break
        l=m+1
        

        
print(m)
s=input()
return s[0]+str(len(s[1:-1]))+s[-1]

### FIXED CODE ###

s=input()
print(s[0]+str(len(s[1:-1]))+s[-1])
import itertools
n = int(input())
l = list(range(1,n+1))
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
r = list(itertools.permutations(l))
for i in range(len(r)):
  if r[i] == p:
    a = i
  elif r[i] == q:
    b = i
print(abs(a-b))

### FIXED CODE ###

import itertools
n = int(input())
l = list(range(1,n+1))
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
r = list(itertools.permutations(l))
for i in range(len(r)):
  if r[i] == p:
    a = i
  if r[i] == q:
    b = i
print(abs(a-b))
s = input()

a = -1
c = -1
lower = 0
for i in range(len(s))
  if s[i] == 'A':
    a = i
  if s[i] == 'C':
    c = i
  if 'a' <= s[i] <= 'z':
    lower += 1

if a == 0 and 2 <= c <= len(s) - 2 and lower == len(s) - 2:
  print('AC')
else:
  print('WA')

### FIXED CODE ###

s = input()

a = -1
c = -1
lower = 0
for i in range(len(s)):
  if s[i] == 'A':
    a = i
  if s[i] == 'C':
    c = i
  if 'a' <= s[i] <= 'z':
    lower += 1

if a == 0 and 2 <= c <= len(s) - 2 and lower == len(s) - 2:
  print('AC')
else:
  print('WA')
#??????????????? : ?¨??????\??????????????????????????????, http://qiita.com/clarinet758/items/53e31ec10b873975438b
a, b = map(int, raw_input().split())

s = a * b
l = 2 * (a + b)

print "%d %d" % (s ,l)

### FIXED CODE ###

#reference : http://qiita.com/clarinet758/items/53e31ec10b873975438b
#reference : #1511943 Solution for ITP1_1_C: Rectangle by Signorte
# print "%d %d" % (s ,l) => ERROR

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

s = a * b
l = 2 * (a + b)

print "%s %s" % (str(s) ,str(l))
n, k = map(int,input().split())
a_list = list(map(int,input().split()))
a_list.sort()

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

sum_val = 0
val = cmb(n-1, k-1)
for i in range(n-k+1):
    if i != 0:
        val = val*(n-i-k+1)/(n-i)
    sum_val = (sum_val + (a_list[-(i+1)]*val) - (a_list[i]*val))%(10**9+7)

print(int(sum_val))

### FIXED CODE ###

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


mod = 10 ** 9 + 7
f_list = [1]
for i in range(1,n+1):
    f_list.append((f_list[-1] * i) % mod)
def comb(n,r):
    return f_list[n] * (pow(f_list[r], mod-2, mod) * pow(f_list[n-r], mod-2, mod) % mod) % mod


max_val = 0
min_val = 0
for i in range(n - k + 1):
    val = comb(n - i - 1, k - 1)
    max_val = (max_val + (((a_list[-(i + 1)]) * val))) % (10 ** 9 + 7)
    min_val = (min_val + ((a_list[i]) * val)) % (10 ** 9 + 7)

print(int((max_val - min_val) % (10 ** 9 + 7)))
from fractions import gcd


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


if K > A[-1]:
    print('IMPOSSIBLE')
else:
    flag = True
    tmp = reduce(gcd, A)
    if tmp != 1:
        flag = False
    for a in A:
        if a == K or (K - a) % tmp == 0:
            flag = True
            break
    if flag:
        print("POSSIBLE")
    else:
        print('IMPOSSIBLE')


### FIXED CODE ###


from fractions import gcd


N, K = map(int, raw_input().split())
A = sorted(list(map(int, raw_input().split())))


if K > A[-1]:
    print('IMPOSSIBLE')
else:
    flag = True
    tmp = reduce(gcd, A)
    if tmp != 1:
        flag = False
    for a in A:
        if a == K or (K - a) % tmp == 0:
            flag = True
            break
    if flag:
        print("POSSIBLE")
    else:
        print('IMPOSSIBLE')
s = input()
cnt = 0
idx = 0
target = "KIHBR"
for i in range(len(s)):
    if s[i] == "A":
        cnt += 1
        if idx == 1 and cnt == 1:
            print("NO")
            exit()
        if cnt >= 2:
            print("NO")
            exit()
    else:
        if idx <= 5 and target[idx] == s[i]:
            idx += 1
            cnt = 0
        else:
            print("NO")
            exit()
if idx == 5:
    print("YES")


### FIXED CODE ###

s = input()
t = "AKIHABARA"
idx = 0
ng = 0
for i in range(len(t)):
    if t[i] == s[idx]:
        idx += 1
    elif t[i] != "A":
        ng = 1
        break
    if idx == len(s):
        if i < len(t) - 2:
            ng = 1

        break

if idx != len(s):
    ng = 1

if ng:
    print("NO")
else:
    print("YES")
a,b,c = = map(int,input().split())

print(max(0,c-a+b))

### FIXED CODE ###

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

print(max(0,c-a+b))
n = input()
if n == "MON":
    print("6")
elif n == "TUE":
    print("5")
elif n == "WEN":
    print("4")
elif n == "THU":
    print("3")
elif n == "FRI":
    print("2")
elif n == "SAT":
    print("1")
else n == "SUN":
    print("7")

### FIXED CODE ###

n = input()
if n == "MON":
    print("6")
elif n == "TUE":
    print("5")
elif n == "WED":
    print("4")
elif n == "THU":
    print("3")
elif n == "FRI":
    print("2")
elif n == "SAT":
    print("1")
else:
    print("7")
import sys

N = int(sys.argv[1]) #偶数の球の数
M = int(sys.argv[2]) #奇数の球の数

def combination(n,r):
    if n == 1:
        ans = 0

    if r != 1:
        ans = n/r * combination(n-1,r-1)
    elif r == 1:
        ans = n/r

    return ans

print(combination(N,2)+combination(M,2))

### FIXED CODE ###

import sys

N, M = map(int, input().split())

def com(n,r):
    ans1 = 1
    ans2 = 1
    tmp = r
    while r != 0:
        ans1 = ans1 * (n)
        ans2 = ans2 * r
        n -= 1
        r -= 1

    return ans1/ans2

print(int(com(N,2)+com(M,2)))
N=int(input())

X=math.ceil(N/1.08)
if X*1.08==N:
    print(int(X))
else:
    print(":(")

### FIXED CODE ###

import math

N=int(input())
X=math.ceil(N/1.08)
if math.floor(X*1.08)==N:
    print(int(X))
else:
    print(":(")
taka, aoki, action = int(input().split())

for i in range(action):
  if taka > 0:
    taka -= 1
    continue
  
  elif aoki > 0:
    aoki -= 1
    continue
  
  else:
    break

print(taka, aoki)

### FIXED CODE ###

taka, aoki, action = map(int, input().split())
 
if taka >= action:
  print(taka-action, aoki)
  
else:
  print(0, max(taka+aoki-action, 0))
n =int(input())

a = [str(x) for x in input().split()]

ls = []

ls.append(a[0)
if n%2==0:
    for i in range(1,n):
        if i%2==0:
            ls.append(a[i])
        else:
            ls.insert(0,a[i])
else:
    for i in range(1,n):
        if i%2==1:
            ls.append(a[i])
        else:
            ls.insert(0,a[i])

print(" ".join(ls))

### FIXED CODE ###

n =int(input())
a = list(map(str,input().split()))
lss = []
lse = []
if n%2==0:
    for i in range(n//2):
        lss.append(a[2*i])
    for i in range(n//2):
        lse.append(a[n-(2*i+1)])

else:
    for i in range(n//2):
        lss.append(a[2*i+1])
    for i in range(n//2+1):
        lse.append(a[n-2*i-1])


ls = lse+lss

print(" ".join(ls))
print("2018"+input([4:]))

### FIXED CODE ###

print("2018"+input()[4:])
N, K = [int(item) for item in input().split()]
h =[0] + [int(item) for item in input().split()]

dp = [0 for _ in range(N+1)]

for i in range(2, N):
    temp = [dp[i-k] + abs(h[i] - h[i-k]) for k in range(1,K) if i - k > 0]
    dp[i] = min(temp)

print(dp[1+N - K])

### FIXED CODE ###

import numpy as np

N, K = [int(item) for item in input().split()]
h =np.array([int(item) for item in input().split()])
# print(h.shape)
dp = np.full(N+K, 10**10+1, dtype='int64')
dp[0] = 0

for i in range(1, N):
    max1 = min(N, i+K)
    cost = abs(h[i:max1] - h[i-1])
    # print(cost.shape, dp[i:max1].shape)
    dp[i:max1] = np.minimum(dp[i:max1], dp[i-1] + cost)

    # print(dp)
print(dp[N-1])
import sys
inputs = list(map(int, sys.stdin))
N = inputs[0]
a = inputs[1:N]
isFound = False
ai = 1
for i in range(1, N + 1):
    ai = a[ai - 1]
#    print(f'a{i} = {ai}')
    if (ai == 2):
        isFound = True
        print(i)
        break
if (isFound is False):
    print(-1)


### FIXED CODE ###

N = int(input())
a = [int(input()) for i in range(N)]
isFound = False
ai = 1
for i in range(1, N + 1):
    ai = a[ai - 1]
#    print(f'a{i} = {ai}')
    if (ai == 2):
        isFound = True
        print(i)
        break
if (isFound is False):
    print(-1)
N = int(input())

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

answer = 0
for _ in range(N):
  answer = gcd(answer, int(input())
               
print(answer)

### FIXED CODE ###

N = int(input())

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

answer = 1
for _ in range(N):
  x = int(input())
  answer *= x//gcd(answer, x)
               
print(answer)
n,k=map(int,input().split())
x=list(map(int,input().split()))

st=0
m=3*10**8
for i in range(n-1):
  if x[i]<0 and x[i+1]>=0:
    st=i+1

for i in range(n-k+2):
  mi=x[k+i-1]-x[i]+min(abs(x[k+i-1]),abs(x[i]))
  print(x[k+i-1],x[i],mi)
  if k+i<st or i>st:continue
  if mi <m:m=mi
print(m)

### FIXED CODE ###

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

import bisect
c=bisect.bisect_left(x,0)
mt=2*10**8

for i in range(n-k+1):
  if i+k<c:continue
  mt=min(mt,2*abs(x[i])+abs(x[i+k-1]),abs(x[i])+2*abs(x[i+k-1]))
  if i+k-1 ==c-1:mt=min(mt,abs(x[i]))
  if i==c:mt=min(mt,x[i+k-1])
if n==k:
  if c!=n and c!=0:
    mt=min(2*abs(x[0])+x[-1],2*x[-1]+abs(x[0]))
  else:
    mt=max(abs(x[0]),abs(x[-1]))
print(mt)
N = input()
s = input()

N1 = int(N)/2

import math
N1= math.ceil(N1)
N1= int(N1)-1
print(N1)

list_s = list(s)
list_s.sort()
X = list_s[N1]

if X=='R':
    print('Yes')
else:
    print('No')

### FIXED CODE ###

ABC = input().split()
list_ABC= list(ABC)

if list_ABC[0] == list_ABC[1] and list_ABC[0] == list_ABC[2]:
    print('Yes')
else:
    print('No')
while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    elif m == -1 or f == -1:
        grade = "F"
    elif (m + f) >= 80:
        grade = "A"
    elif (m + f) => 65:
        grade = "B"
    elif (m + f) => 50:
        grade = "C"
    elif (m + f) => 30:
        if r > 50:
            grade = "C"
        else:
            grade = "D"
    else:
        grade = "F"
    print(grade)


### FIXED CODE ###

while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    elif m == -1 or f == -1:
        grade = "F"
    elif (m + f) >= 80:
        grade = "A"
    elif (m + f) >= 65:
        grade = "B"
    elif (m + f) >= 50:
        grade = "C"
    elif (m + f) >= 30:
        if r >= 50:
            grade = "C"
        else:
            grade = "D"
    else:
        grade = "F"
    print(grade)
Town = []
C = 0
N, K = map(int, input().split())
A = list(map(int, input().split()))
def dfs(a, i, town, c):
    if i-1 in town:
        L = len(town) - len(town[:town.index(i-1)])
        c += (K - c) - (K%L)
        town = []
        town.append(i-1)
    else:
        town.append(i-1)
        c += 1
    if c == K:
        return print(a[i-1])
    nx = a[i-1]
    dfs(a, nx, town, c)

dfs(A, 1, Town, C)

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
vis = [0]*N
p = 1
Town = []

while vis[p-1] == 0:
    Town.append(p)
    vis[p-1] = 1
    p = A[p-1]

l = Town.index(p)

if K < len(Town):
    print(Town[K])
else:
    print(Town[l + (K-l)%(len(Town[l:]))])
n = input()
S = input().split()
q = input()
T = input().split()

print(len(S&T))

### FIXED CODE ###

n = int(input())
S = input().split()
q = int(input())
T = input().split()

#print(len(S&T))
#set:???????????????????????????

cnt = 0

for i in range(len(T)):
    left = 0
    right = n
    while left < right:
        mid = (left+right) // 2
        if int(S[mid]) == int(T[i]):
            cnt += 1
            break
        elif int(S[mid]) < int(T[i]):
            left = mid+1
        else:
            right = mid
print(cnt)
def upper_or_lower(i):
    if A[i] < A[i + 1]:
        return "upper"
    elif A[i] > A[i + 1]:
        return "lower"
    else:
        return upper_or_lower(i + 1)


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

state = "upper"  # state が upper か lower で判定
ans = 1

# i = 0 の処理
if A[0] > A[1]:
    state = "lower"

for i in range(2, N):
    if (state == "upper") and (A[i - 1] > A[i]):
        ans += 1
        if i < N - 1:
            state = upper_or_lower(i)
    elif (state == "lower") and (A[i - 1] < A[i]):
        ans += 1
        if i < N - 1:
            state = upper_or_lower(i)
    else:
        continue

print(ans)


### FIXED CODE ###

def upper_or_lower(i):
    if A[i] < A[i + 1]:
        return "upper"
    elif A[i] > A[i + 1]:
        return "lower"
    else:
        return upper_or_lower(i + 1)


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

state = "upper"  # state が upper か lower で判定
ans = 1

# i = 0 の処理
if (len(A) > 2) and (A[0] > A[1]):
    state = "lower"

for i in range(2, N):
    if (state == "upper") and (A[i - 1] > A[i]):
        ans += 1
        if i < N - 1:
            state = upper_or_lower(i)
    elif (state == "lower") and (A[i - 1] < A[i]):
        ans += 1
        if i < N - 1:
            state = upper_or_lower(i)
    else:
        continue

print(ans)
s=input()
ans=0
for x in range(1,len(s)+1):
	for left in range(s-x+1):
		z=s[left:left+x]
		flag=True
		for i in range(x):
			if z[i]!="A" and z[i]!="G" and z[i]!="C" and z[i]!="T":
				flag=False
				break
		if flag==True:
			ans+=1
			break
print(ans)

### FIXED CODE ###

s=input()
ans=0
for x in range(1,len(s)+1):
	for left in range(len(s)-x+1):
		z=s[left:left+x]
		flag=True
		for i in range(x):
			if z[i]!="A" and z[i]!="G" and z[i]!="C" and z[i]!="T":
				flag=False
				break
		if flag==True:
			ans+=1
			break
print(ans)
N = int(input())
A = [a for a in map(int, input().split())]

#N個のボールに対して、書かれている数字は1~Nまで

dic1 = {}
for i in range(N):
    dic1[i] = 0

#dicにkeyとなる数字の個数を入れていく
for i in A:
    if i in dic1.keys():
        dic1[i] += 1

dic2 = {}
#組み合わせの数を入れる   
for i in range(N):
    dic2[i] = dic1[i]*(dic1[i]-1)/2

ans1 = 0
for i in range(N):
    ans1 += dic2[i]

for i in range(N):
    ans2 = ans1
    ans2 -= dic2[A[i]] #組み合わせの数を引く
    ans2 += (dic1[A[i]]-1)*(dic1[A[i]]-2)/2 #新たな組み合わせの数を足す
    print(int(ans2))

### FIXED CODE ###

N = int(input())
A = [a for a in map(int, input().split())]

#N個のボールに対して、書かれている数字は1~Nまで

dic1 = {}
for i in range(N):
    dic1[i+1] = 0

#dicにkeyとなる数字の個数を入れていく
for i in range(N):
    if A[i] in dic1.keys():
        dic1[A[i]] += 1

dic2 = {}
#組み合わせの数を入れる   
for i in range(N):
    dic2[i+1] = dic1[i+1]*(dic1[i+1]-1)/2

ans1 = 0
for i in range(N):
    ans1 += dic2[i+1]

for i in range(N):
    ans2 = ans1
    ans2 -= dic2[A[i]] #組み合わせの数を引く
    ans2 += (dic1[A[i]]-1)*(dic1[A[i]]-2)/2 #新たな組み合わせの数を足す
    print(int(ans2))
n=int(input())
p=list(map(int,input().split()))
stack=[0]*(n+1)
ans=0
if p[0]==0:
  p[0]=1
  ans+=1
  stack[1]=1
else:
  stack[1]=p[0]
for i in range(1,n):
  if i%2==1:
    if p[i]+p[i-1]+stack[i-1]>=0:
      p[i]-=(p[i]+p[i-1]+stack[i-1])+1
      ans+=(p[i]+p[i-1]+stack[i-1])+1
  else:
    if p[i]+p[i-1]+stack[i-1]<=0:
      p[i]+=-(p[i]+p[i-1]+stack[i-1])+1
      ans+=-(p[i]+p[i-1]+stack[i-1])+1
  stack=p[i]+p[i-1]+stack[i-1]
print(ans)      

### FIXED CODE ###

n=int(input())
p=list(map(int,input().split()))
p2=[i for i in p]
stack=[0]*(n+1)
ans=0
if p[0]<=0:
  ans+=1-p[0]
  p[0]=1
  stack[1]=1
else:
  stack[1]=p[0]
for i in range(1,n):
  if i%2==1:
    if p[i]+p[i-1]+stack[i-1]>=0:
      ans+=(p[i]+p[i-1]+stack[i-1])+1
      p[i]-=(p[i]+p[i-1]+stack[i-1])+1
  else:
    if p[i]+p[i-1]+stack[i-1]<=0:
      ans+=-(p[i]+p[i-1]+stack[i-1])+1
      p[i]+=-(p[i]+p[i-1]+stack[i-1])+1
  stack[i+1]=p[i]+p[i-1]+stack[i-1]
stack=[0]*(n+1)
ans2=0
if p2[0]>=0:
  ans2+=p2[0]+1
  p2[0]=-1
  stack[1]=-1
else:
  stack[1]=p2[0]
for i in range(1,n):
  if i%2==0:
    if p2[i]+p2[i-1]+stack[i-1]>=0:
      ans2+=(p2[i]+p2[i-1]+stack[i-1])+1
      p2[i]-=(p2[i]+p2[i-1]+stack[i-1])+1
  else:
    if p2[i]+p2[i-1]+stack[i-1]<=0:
      ans2+=-(p2[i]+p2[i-1]+stack[i-1])+1
      p2[i]+=-(p2[i]+p2[i-1]+stack[i-1])+1
  stack[i+1]=p2[i]+p2[i-1]+stack[i-1]
print(min(ans,ans2))
n = int(input())
if n="A":
  print("T")
elif n="T":
  print("A")
elif n="G":
  print("C")
else:
  print("G")

### FIXED CODE ###

n = input()
if n=="A":
  print("T")
elif n=="T":
  print("A")
elif n=="G":
  print("C")
else:
  print("G")
from collections import deque

N, A, B, C = map(int, input().split())
L = [int(input()) for _ in range(N)]
minMP = 10**5

p = deque()
p.append([-1] * len(L))
while p:
    stats = p.pop()
    stats = list(stats)
    a, b, c = 0, 0, 0
    MP = 0
    cntA = 0; cntB = 0; cntC = 0
    for i in range(N):
        if stats[i] == 1:
            a += L[i]
            cntA += 1
        elif stats[i] == 2:
            b += L[i]
            cntB += 1
        elif stats[i] == 3:
            c += L[i]
            cntC += 1

    if cntA >= 1 and cntB >= 1 and cntC >= 1:
        MP += abs(A - a) + abs(B - b) + abs(C - c) + 10 * (cntA+cntB+cntC-3)
        minMP = min(minMP, MP)

    if not -1 in stats:
        continue
    j = stats.index(-1)
    for k in range(4):
        stats[j] = k
        newStats = tuple(stats)
        p.append(newStats)
        print(newStats)
print(minMP)
input()


### FIXED CODE ###

from collections import deque

N, A, B, C = map(int, input().split())
L = [int(input()) for _ in range(N)]
minMP = 10**5

p = deque()
p.append([-1] * len(L))
while p:
    stats = p.pop()
    stats = list(stats)
    a, b, c = 0, 0, 0
    MP = 0
    cntA = 0; cntB = 0; cntC = 0
    for i in range(N):
        if stats[i] == 1:
            a += L[i]
            cntA += 1
        elif stats[i] == 2:
            b += L[i]
            cntB += 1
        elif stats[i] == 3:
            c += L[i]
            cntC += 1

    if cntA >= 1 and cntB >= 1 and cntC >= 1:
        MP += abs(A - a) + abs(B - b) + abs(C - c) + 10 * (cntA+cntB+cntC-3)
        minMP = min(minMP, MP)

    if not -1 in stats:
        continue
    j = stats.index(-1)
    for k in range(4):
        stats[j] = k
        newStats = tuple(stats)
        p.append(newStats)

print(minMP)
import heapq
k = int(input())
run_list = [i for i in range(1,10)]
heapq.heapify(run_list)
result = 0
for i in range(k):
  result = heapq.pop(run_list)
  if result % 10 ==0:
    new_1 = result * 10
    new_2 = result * 10 + 1
    heapq.heappush(run_list, new_1)
    heapq.heappush(run_list, new_2)
  elif result % 10 ==9:
    new_1 = result * 10 + 8
    new_2 = result * 10 + 9
    heapq.heappush(run_list, new_1)
    heapq.heappush(run_list, new_2)
  else:
    new_1 = result * 10 + (resut % 10)
    new_2 = result * 10 + (resut % 10) + 1
    new_3 = result * 10 + (resut % 10) - 1
    heapq.heappush(run_list, new_1)
    heapq.heappush(run_list, new_2)
print(result)
    heapq.heappush(run_list, new_3)

### FIXED CODE ###

import heapq
k = int(input())
run_list = [i for i in range(1,10)]
heapq.heapify(run_list)
result = 0
for i in range(k):
  result = heapq.heappop(run_list)
  if result % 10 ==0:
    new_1 = result * 10
    new_2 = result * 10 + 1
    heapq.heappush(run_list, new_1)
    heapq.heappush(run_list, new_2)
  elif result % 10 ==9:
    new_1 = result * 10 + 8
    new_2 = result * 10 + 9
    heapq.heappush(run_list, new_1)
    heapq.heappush(run_list, new_2)
  else:
    new_1 = result * 10 + (result % 10)
    new_2 = result * 10 + (result % 10) + 1
    new_3 = result * 10 + (result % 10) - 1
    heapq.heappush(run_list, new_1)
    heapq.heappush(run_list, new_2)
    heapq.heappush(run_list, new_3)
print(result)
a,b = map(int,input().split())
print(a*b,2*a+2*b)

### FIXED CODE ###

a,b=map(int,raw_input().split())
print a*b, 2*a+2*b
a , b = map(int, input().split())
if (a * b %% 2 == 1) :
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a , b = map(int, input().split())
if (a * b % 2 == 1) :
  print("Yes")
else:
  print("No")