Harryxun/stf_run huggingface dataset:
import sys
X, Y, A, B, C = sys.stdin.readline().split()
X = int(X)
Y = int(Y)
C = int(C)
scoreA = map(int, sys.stdin.readline().split())
scoreB = map(int, sys.stdin.readline().split())
scoreC = map(int, sys.stdin.readline().split())
scoreA.sort(reverse=True)
scoreB.sort(reverse=True)
scoreC.sort(reverse=True)
scoreA = scoreA[:X-1]
scoreB = scoreB[:Y-1]
scoreAll = scoreA + scoreB + scoreC
scoreAll.sort(reverse=True)
print(sum(scoreAll[:X+Y-1]))


### FIXED CODE ###

import sys
X, Y, A, B, C = sys.stdin.readline().split()
X = int(X)
Y = int(Y)
C = int(C)
scoreA = list(map(int, sys.stdin.readline().split()))
scoreB = list(map(int, sys.stdin.readline().split()))
scoreC = list(map(int, sys.stdin.readline().split()))
scoreA.sort(reverse=True)
scoreB.sort(reverse=True)
scoreC.sort(reverse=True)
scoreA = scoreA[:X]
scoreB = scoreB[:Y]
scoreAll = scoreA + scoreB + scoreC
scoreAll.sort(reverse=True)
print(sum(scoreAll[:X+Y]))
N = input()
H = [s for s in input().split()]

HIEST = H[0]
COUNT = 0
for i in H:

    if i >= HIEST:
        HIEST = i
        COUNT = COUNT+1

print(COUNT)

### FIXED CODE ###

A,B=(int(x) for x in input().split())

if A == B:
    COINS=2*A
    
elif A > B:
    COINS=2*A-1

else:
    COINS=2*B-1

print(COINS)
r = int(input())
print(3*R**2)

### FIXED CODE ###

a = int(input())
print (3*a**2)
a, b = input().split()

if a == b:
  print('H'):
else:
  print('D')

### FIXED CODE ###

a, b = input().split()
if a == b:
  print('H')
else:
  print('D')
n = int.input()
a = map(int,input().split())
t = 1

for i in a:
  t *= i

if t >10**18:
  print("-1")
else:
  print(str(t))

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
a.sort()
t = 1
 
for i in range(len(a)):
  t *= a[i]
  if t > 10**18:
    break
 
if t > 10**18 :
  print("-1")
else:
  print(str(t))
N, T = map(int, input().split())
cage,cage2=[],[]
for i in range(N):
  c, t = map(int, input().split())
  if t<=T:
	cage.append(c)
    cage2.append(n)
if cage==None:
  print("TLE")
else:
  print(soted(cage)[0])

### FIXED CODE ###

N, T = map(int, input().split())
cage,cage2=[],[]
for i in range(N):
  c, t = map(int, input().split())
  if t<=T:
      cage.append(c)
if len(cage)==0:
  print("TLE")
else:
  print(min(cage))
s = input()

if s == "Sunny" :
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
elif s == "Rainy"
    print("Sunny")


### FIXED CODE ###

s = input()

if s == "Sunny" :
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
else :
    print("Sunny")
from itertools import permutations
N = int(input())

val = []
for _ in range(N):
    val.append(int(input()))
ans = 10**10
for i in permutations(val):
    for j in range(1, N):
        ans = min(max(sum(i[:j]), sum(i[j:])), ans)
if N == 1:
    print(val[0])
else:
    print(ans)
    

    


### FIXED CODE ###

S = input()
ans = 0
count = 0
for i in S:
    if i == 'B':
        count += 1
    elif i == 'W':
        ans += count
print(ans)
[n,m] = [int(i) for i in input().split()]
ab = []
dic = {}
for i in range(m):
  ab.append([int(j) for j in input().split()])

for i in range(m):
  if ab[i][0] in dic.keys():
	  dic[ab[i][0]] += 1
  else:
    dic[ab[i][0]] = 1
    
  if  ab[i][1] in dic.keys():
	  dic[ab[i][1]] += 1
  else:
    dic[ab[i][1]] = 1
    
for i in range(n):
  print(dic[i+1])

### FIXED CODE ###

[n,m] = [int(i) for i in input().split()]
ab = []
dic = {}
for i in range(m):
  ab.append([int(j) for j in input().split()])

for i in range(m):
  if ab[i][0] in dic.keys():
    dic[ab[i][0]] += 1
  else:
    dic[ab[i][0]] = 1
    
  if  ab[i][1] in dic.keys():
    dic[ab[i][1]] += 1
  else:
    dic[ab[i][1]] = 1
    
for i in range(n):
  if i+1 in dic.keys():
    print(dic[i+1])
  else:
    print(0)
N = int(input())
for i in range(17):
    a = (N + 1) // (10 ** i)
    if a:
        b = a
    elif a == 0:
        c = (i -1) * 9 + b - 1
        break
print(c)

### FIXED CODE ###

N = int(input())
for i in range(18):
    a = (N + 1) // (10 ** i)
    if a:
        b = a
    elif a == 0:
        c = (i -1) * 9 + b - 1
        break
print(c)
abc=[int(i) for i in input().split()]
num_five=0
num_seven=0
for i in range(3):
  if abc[i]==5:
    num_five+=1
  elif abc[i]==7:
    num_five+=1

if num_five==2 and num_seven==1:
  print("YES")
 else:
  print("NO")


### FIXED CODE ###

abc=[int(i) for i in input().split()]
num_five=0
num_seven=0

for i in range(3):
  if abc[i]==5:
    num_five+=1
  elif abc[i]==7:
    num_seven+=1

if num_five==2 and num_seven==1:
  print("YES")
else:
  print("NO")
import math

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

a = list(map(int, input().split()))
n -= 1
k -= 1
ans = (n + k - 1) // k

print(ans)


### FIXED CODE ###

import math

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

a = list(map(int, input().split()))
n -= 1
k -= 1
ans = math.ceil(n / k)

print(ans)
S = []
for _ in range(N):
  S.append(input().split())
G = []
for i in range(N):
  if S[i][0] == S[i][1]:
    G.append("1")
  else:
    G.append("0")

AN = (''.join(G))

if "111" in AN:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N = int(input())
S = []
for j in range(N):
  S.append(input().split())
G = []
for i in range(N):
  if S[i][0] == S[i][1]:
    G.append("1")
  else:
    G.append("0")

AN = (''.join(G))

if "111" in AN:
  print("Yes")
else:
  print("No")
n, k, q = map(int,input().split())
points = [k-q]*n

for i in range(q):
  m = int(input())
  points[m-1] = points[m-1] + 1
  print(points)

for j in range(len(points)):
  if points[j] <= 0:
    print('No')
  else:
    print('Yes')

### FIXED CODE ###

n, k, q = map(int,input().split())
points = [k-q]*n

for i in range(q):
  m = int(input())
  points[m-1] = points[m-1] + 1

for j in range(len(points)):
  if points[j] <= 0:
    print('No')
  else:
    print('Yes')
n=int(input())
h=[int(i) for i in input().split()]
c=0
l=[]
for i in range(n-1):  
    if h[i]>h[i+1]:
      c+=1
    else:
      c=0
    l.append(c)
print(max(l))

### FIXED CODE ###

N=int(input())
H=list(map(int,input().split()))
ans=0
tmp=0
for i in range(N-1):
    if H[i]>=H[i+1]:
        tmp+=1
    else:
        tmp=0
    ans=max(ans,tmp)
print(ans)
import math
a, b, x = map(float, input().split())
_x = x / a
if _x <= a * b / 2.0:
    theta = math.atan(_x * 2.0 / b / b)
    print(90.0 - math.degrees(theta))
else:
    _x = a * b - _x
    theta = math.atan(a * a / 2.0 / _x)
    print(90.0 - math.degrees(theta))


### FIXED CODE ###

import math
a, b, x = map(int, input().split())
_x = x / a
if _x == a * b:
    print(0.0)
elif _x <= a * b / 2:
    theta = math.atan(_x * 2 / b / b)
    print(90 - math.degrees(theta))
else:
    _x = a * b - _x
    theta = math.atan(a * a / 2 / _x)
    print(90 - math.degrees(theta))
arg=input()
x=len(arg)
count=0
d=[]

for i in arg:
    if(i=="A" or i=="C" or i=="G" or i=="T"):
        count=count+1
        d.append(count)
    else:
        count=0

print(max(d))


### FIXED CODE ###


arg=input()
x=len(arg)
count=0
d=[0]

for i in arg:
    if(i=="A" or i=="C" or i=="G" or i=="T"):
        count=count+1
        d.append(count)
    else:
        count=0

print(max(d))
N,K = map(int,input().split())
A = list(map(int, input().split()))


#一回あたりのループを計算（何回で戻ってくるか）
#ループの箇所を見つける
trace = [0]*N
loop_start = 0
loop_before = 0
cnt = 0
all_cnt = 0

if K > N:
    loop = 0
    now = 0
    while(1):
        # print(trace)
        trace[now] += 1
        if trace[now] == 3:
            break
        if trace[now] == 2:
            cnt += 1
            loop += 1 
            if cnt == 1: 
                loop_start = now
                loop_before = all_cnt
        now = A[now]-1
        all_cnt += 1

loop_before = loop_before - loop 

# print(loop)
# print(loop_start)
# print(loop_before)
# print(loop)
min_K = (K-1-loop_before) % loop
# print(min_K)
# print(loop_before)
now = 0
for i in range(loop_before):
    now = A[now]-1
for i in range(min_K):
    now = A[now]-1
print(A[now])

# print(K % 3)

# print(now+1)




    

### FIXED CODE ###

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


#一回あたりのループを計算（何回で戻ってくるか）
#ループの箇所を見つける
trace = [0]*N
loop_start = 0
loop_before = 0
cnt = 0
all_cnt = 0

if K > N:
    loop = 0
    now = 0
    while(1):
        # print(trace)
        trace[now] += 1
        if trace[now] == 3:
            break
        if trace[now] == 2:
            cnt += 1
            loop += 1 
            if cnt == 1: 
                loop_start = now
                loop_before = all_cnt
        now = A[now]-1
        all_cnt += 1

    loop_before = loop_before - loop 

    # print(loop)
    # print(loop_start)
    # print(loop_before)
    # print(loop)
    min_K = (K-1-loop_before) % loop
    # print(min_K)
    # print(loop_before)
    now = 0
    for i in range(loop_before):
        now = A[now]-1
    for i in range(min_K):
        now = A[now]-1
    print(A[now])

if K <= N:
    now = 0
    for i in range(K-1):
        now = A[now]-1
    print(A[now])


# print(K % 3)

# print(now+1)
n, l = map(int, input().split())
s = [int(input()) for i in range(n)]

s.sort()
S = ""
for i in s:
    S += i
print(S)


### FIXED CODE ###

n, l = map(int, input().split())
s = [input() for i in range(n)]

s.sort()
S = ""
for i in s:
    S += i
print(S)
N = int(input())
A = list(map(int, input().split()))
for i in range(N//2, -1, -1):
  sum = 0
  for o in range(1, (N//o)+1):
    sum += A[i*o-1]
  A[i] = sum%2
  
print(A.count(1))
ans = [str(q) for q,w in zip(range(N), A) if w == 1]
print(" ".join(ans))    

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
for i in range(N//2+1, 0, -1):
  sum = 0
  for o in range(1, (N//i)+1):
    sum += A[i*o-1]
  A[i-1] = sum%2
  
print(A.count(1))
ans = [str(q) for q,w in zip(range(1, N+1), A) if w == 1]
print(" ".join(ans))
a=["eraser","erase","dreamer","dream"]
s=input()
for i in range(4):
    s=s.replace(a[i],"")
if s="":
    print("YES")
else:
    print("NO")

### FIXED CODE ###

print("vowel" if input() in "aiueo" else "consonant")
a,b,c=map(int,input())
print(9*max(a,b,c)+a+b+c)

### FIXED CODE ###

a,b,c=map(int,input().split())
print(9*max(a,b,c)+a+b+c)
A,B,C,A,B,C,K=map(int,input().split())
if K<=A:
  print(K)
elif A<K<=A+B:
  print(A)
elif A+B<K<=A+B+C:
  print(2*A+B-K)
  

### FIXED CODE ###

A,B,C,K=map(int,input().split())
if K<=A:
  print(K)
elif A<K<=A+B:
  print(A)
elif A+B<K<=A+B+C:
  print(2*A+B-K)
a = input().split(" ")
cnt=0
for i, ai in enumerate(a):
  if ai==0
  return i+1

### FIXED CODE ###

a = input().split(" ")
temp = 0
for i, ai in enumerate(a):
    if int(ai)==0:
        temp=i
        break
 
print(temp+1)
for i in range(1000)
print "Hello World"

### FIXED CODE ###

for i in range(1000):
    print 'Hello World'
import numpy as np
def main():
    #ttt = []
    n = int(input())
    e = [list(map(int, input().split())) for _ in range(n)]
    #e = [[int(i) for i in input().split()] for i in range(int(input()))]
    #n = 3
    #e = [[21,-11],[81234,94124,52141]]
    for j in range(n):
        t = e[0][0] - e[1][j]*0.006
        tt = abs(e[0][1] - t)
        ttt.append(tt)
    ttt = np.array(ttt)
    print(np.argmin(ttt)+1)
ttt = []
main()


### FIXED CODE ###

import numpy as np
def main():
    ttt = []
    n = int(input())
    N, M = map(int, input().split())
    e = list(map(int, input().split()))
    #e = [[int(i) for i in input().split()] for i in range(int(input()))]
    #n = 3
    #e = [[21,-11],[81234,94124,52141
    for j in range(n):
        t = N - e[j]*0.006
        tt = abs(M - t)
        ttt.append(tt)
    ttt = np.array(ttt)
    print(np.argmin(ttt)+1)
main()
def z(x):
  if x == 0:
  	return 10
  else:
    return x
menu = [int(input()) for i in range(5)]
dist = list(map(lambda x: x%10, menu))
dist2 = list(map(lambda x: z(x), dist))
idx = dist.index(min(dist2))
dist2.pop(idx)
inv = list(map(lambda x: 10-x, dist2))
cost = sum(menu) + sum(inv)
print(cost)

### FIXED CODE ###

dish = [0]*5
inv = [0]*5

for i in range(5):
  dish[i] = int(input())
  inv[i] = (10-dish[i]%10)%10
  
cost = sum(dish) + sum(inv) - max(inv)
print(cost)
primes = [0, 0] + [1]*999999
for i in range(2, 1001):
    for j in range(i*i, 1000001, i):
        primes[j] = 0

while True:
    n = int(input())
    if n == 0:
        break
    for i in range(5, n+1)[::-1]:
        if primes[i] and primes[i-2] and primes[i-6] and primes[i-8]:
            print(i)
            break

### FIXED CODE ###

import bisect


primes = [0, 0] + [1] * 9999999
for i in range(2, 3163):
    if primes[i]:
        for j in range(i*i, 10000001, i):
            primes[j] = 0

values = [i for i, v in enumerate(primes) if v]
while True:
    n = int(input())
    if n == 0:
        break
    index = bisect.bisect(values, n)
    for i in range(2, index)[::-1]:
        if all(primes[values[i]-j] for j in [0, 2, 6, 8]):
            print(values[i])
            break
n,m=list(map(int,input().split()))
ac,wa=0,0
aclis=[0]*n
walis=[0]*n

for i in range(m):
  p,s=input().split()
  p = int(p)  
  if s == "AC" and aclis[p-1] == 0:
    aclis[p-1] = 1
    ac += 1
    wa += wa[p-1]
  elif s == "WA" and aclis[p-1] == 0:
    wa[p-1] += 1
print(ac,wa)

### FIXED CODE ###

n,m=list(map(int,input().split()))
ac,wa=0,0
aclis=[0]*n
walis=[0]*n

for i in range(m):
  p,s=input().split()
  p = int(p)  
  if s == "AC" and aclis[p-1] == 0:
    aclis[p-1] = 1
    ac += 1
    wa += walis[p-1]
  elif s == "WA" and aclis[p-1] == 0:
    walis[p-1] += 1
print(ac,wa)
a = int(input())
s = input()

if a >= 2300:
  print(s)
  else:
    print("red")

### FIXED CODE ###

a = int(input())
s = input()

if a >= 3200:
  print(s)
else:
  print("red")
h,w  = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))
res = []
for _ in range(h):
    res.append("")
line = 0

def insert(res,i,l):
    if l %2 == 0:
        res[l] = res[l] + str(i+1)
    else:
        res[l] = str(i+1) + res[l]

for i in range(0,n):
    ammount=a[i]
    while len(res[line]) < w and ammount > 0:
        insert(res,i,line)
        ammount -= 1
    if len(res[line]) == w:
        line += 1
    while ammount >= w:
        res[line] = str(i+1) * w
        ammount -= w
        line += 1
    if ammount > 0:
        res[line] = str(i+1) * ammount

res_se = []
for st in res:
    res_se.append(list(st))

for i in range(0,h):
    print(' '.join(res_se[i]))

### FIXED CODE ###

h,w  = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))
res = []
for _ in range(h):
    res.append([])
line = 0

def insert(res,i,l):
    if l %2 == 0:
        res[l].append(str(i+1))
    else:
        res[l].insert(0,str(i+1))

for i in range(0,n):
    ammount=a[i]
    while len(res[line]) < w and ammount > 0:
        insert(res,i,line)
        ammount -= 1
    if len(res[line]) == w:
        line += 1
    while ammount >= w:
        res[line] = [str(i+1) for _ in range(w)]
        ammount -= w
        line += 1
    if ammount > 0:
        res[line] = [str(i+1) for _ in range(ammount)]

for i in range(0,h):
    print(' '.join(res[i]))
k = int(input())
list=[]
import math import gcs

for i in range(k+1):
    for j in range(k+1):
        for m in range(k+1):
            n = math.gcd(i,j)
            a = math.gcd(n,m)
            list.append(int(a))

ans = sum(list)
print(ans)


### FIXED CODE ###

from math import gcd
k=int(input())
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        ans_=gcd(i,j)
        for l in range(1,k+1):
            ans+=gcd(ans_,l)
print(ans)
N = int(input())
L = list(map(int, input().split()))

count_list = [0] * N
for i in range(0,N):
	if L[i] > L[i+1]:
		counter += 1
		count_list.append(counter)

			
print(max(count_list))

### FIXED CODE ###

N = int(input())
L = [int(i) for i in input().split()]

Max =  0
Count = 0
for i in range(N-1):
    if L[i] >= L[i+1]:
        Count += 1
    else:
        Count = 0
    if Count >= Max:
        Max = Count
print(Max)
N = int(raw_input())
health = map(int, raw_input().split())

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

def gcd_driver(lst):
	if len(lst) <= 1:
		return lst[0]
	if len(lst) > 2:
		lst[1] = gcd(lst[0], lst[1])
		return gcd_driver(lst[1:])
	else:
		return gcd(lst[0], lst[1])

print gcd_driver(health)


### FIXED CODE ###

N = int(raw_input())
health = map(int, raw_input().strip().split())

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

if len(health) == 1:
	print health[0]
else:
	g = gcd(health[0], health[1])
	for i in range(2, len(health)):
		g = gcd(g, health[i])
print g
X,N = list(map(int, input().split()))
if N == 0:
	print(X)
else:
	p = list(map(int,input().split()))
a = 0
b = 0
for i in range(N + 1):
  a = X + i
  b = X - i
  if p.count(b) == 0:
    print(b)
    exit(0)
  elif p.count(a) == 0:
    print(a)
    exit(0)


### FIXED CODE ###

X, N = map(int, input().split())
p = list(map(int, input().split()))
for d in range(X + 1):
	for s in [-1, +1]:
		a = X + s * d
		if p.count(a) == 0:
			print(a)
			exit(0)
s=input()
i=1
ans=''
 
while i<=len(s):
  if s[i-1]=='A'|s[i-1]=='C'|s[i-1]=='G'|s[i-1]=='T':
    ans=ans+s[i-1]
  i+=1
 
print (len(ans))

### FIXED CODE ###

s=input()
i=1
n=0
ans=[0]
sta=0

 
while i<=len(s):
  if s[i-1]=='A'or s[i-1]=='C' or s[i-1]=='G' or s[i-1]=='T':
    n=n+1
    sta=1
  elif sta==1:
    ans.append(n)
    n=0

  if i<=len(s)&n==len(s):
    ans.append(n)
  elif n!=0:
      ans.append(n)
    
  i=i+1
  
print(max(ans))
n = int(input())
l = {}
lb = []
la = []
c = 0
for _ in range(n):
    a,b = map(int,input().split())
    l[b] = a
l = sorted(l.items())
for i in range(0,n):
    lb.append(l[i][0])
    la.append(l[i][1])

for i in range(0,n):
    if lb[i] < sum(la[:i+1]):
        c = 1
        break
    else:
        continue
if c == 0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n = int(input())
l = []
c = 0
d = 0
for _ in range(n):
    a,b = map(int,input().split())
    l.append([b,a])
l = sorted(l)


for i in range(0,n):
    if l[i][0] < d + l[i][1]:
        c = 1
        break
    else:
        d = d+ l[i][1]
        continue
if c == 0:
    print('Yes')
else:
    print('No')
def main():
    # input
    t1, t2 = map(int, input().split())
    a1, a2 = map(int, input().split())
    b1, b2 = map(int, input().split())

    x = (a1-b1)*t1
    y = (a2-b2)*t2
    diff = x+y

    print(x)
    print(y)
    print(diff)

    if x == -y:
        print("infinity")
        return
    elif x*y > 0:
        print(0)
        return

    if diff > 0: # aが先行
        if x<0:
            x = abs(x)
            ans = x//diff
        else:
            y = abs(y)
            ans = y//diff

    else: # bが先行
        diff = ans(diff)
        if x>0:
            ans = x//diff
        else:
            ans = y//diff

    print(ans*2+1)

    # calc


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    # input
    import math
    t1, t2 = map(int, input().split())
    a1, a2 = map(int, input().split())
    b1, b2 = map(int, input().split())

    x = (a1-b1)*t1
    y = (a2-b2)*t2
    diff = x+y

    if x == -y:
        print("infinity")
        return
    elif x*y>0 or abs(x)>abs(y):
        print(0)
        return

    x = abs(x)
    diff = abs(diff)
    ans = x//diff
    remainder = x%diff
    if remainder==0:
        print(ans*2)
    else:
        print(ans*2+1)

    # calc

if __name__ == '__main__':
    main()
while 1:
	try:
		n = input()
		x = 0
		if n < 37:
			for a in range(10):
				for b in range(10):
					for c in range(10):
						for d in range(10):
							if a + b + c + d == n:
								x += 1
			print x
		except EOFError:
			break

### FIXED CODE ###

while 1:
	try:
		n = input()
		x = 0
		if n < 37:
			for a in range(10):
				for b in range(10):
					for c in range(10):
						for d in range(10):
							if a + b + c + d == n:
									x += 1
		print x
	except EOFError:
		break
n = int(input())
a = list(map(int,input().split()))
x = []
b = 0
ans = 0

for i in range(n):
    x.append(a[i] - i-1)
x = sorted(x)


if n%2 == 0:
    b = (x[n//2]-x[(n-1)//2])/2
else:
    b = (x[(n//2)])

for i in range(n):
    ans += abs(a[i]-b-i-1)

print(ans)

### FIXED CODE ###

n = int(input())

if n % 2 == 0:
    print(n)
else:
    print(n*2)
a, b = map(int, intpu().split())
print(max(a + b, a - b, a * b))


### FIXED CODE ###

a, b = map(int, input().split())
print(max(a + b, a - b, a * b))
n,q = map(int(input().split()))
s = input()
m = list(map(int,input().split for i in range(q)))
count = [0]*(N+1)

for i in range(N):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]

for l,r in list:
    print(count[r-1]-count[l-1])


### FIXED CODE ###

s = input()
p = s.replace('A','B')
q = p.replace('T','A')
r = q.replace('B','T')
w = r.replace('G','W')
x = w.replace('C','G')
y = x.replace('W','C')
print(y)
S = input()
mod2019 = [0]*(len(S)+1)

for i in range(len(S)):
    mod2019[i] = int(S[i:-1])%2019

answer = 0
count = [0 for _ in range(2020)]


for i in range(len(S)):
    answer += count[mod2019[i]]
    count[mod2019[i]] += 1
print(answer)

### FIXED CODE ###

S = input()
mod2019 = [0]*len(S)

mod2019[-1] = int(S[-1])
keta_mod = 1
for i in range(len(S)-2,-1,-1):
    keta_mod = (keta_mod*10)%2019
    mod2019[i] = (mod2019[i+1] + int(S[i])*keta_mod)%2019

mod2019.extend([0])

answer = 0
count = [0 for _ in range(2020)]

for i in range(len(S)+1):
    answer += count[mod2019[i]]
    count[mod2019[i]] += 1
print(answer)
n,m,q=map(int,input().split())
alist=[]
for i in range(m):
    l,r=map(int,input().split())
    alist.append([l,r])
alist.sort()
for t in range(q):
    count=0
    blist=[]
    p,q=map(int,input().split())
    for j in range (len(alist)):
        if p<=alist[0][0]:
            alist.sort(key=lambda x:x[1])
            break
        blist.append(alist[0])
        alist.remove(alist[0])
    for j in range (len(alist)):
        if q>=alist[j][1]:
            count+=1
        else:
            break
    for k in blist:
        alist.append(k)
    print(count)
    alist.sort(key=lambda x:x[0])

### FIXED CODE ###

a,b=map(int,input().split())
print((a-1)*(b-1))
import numpy as np

class Tropical():
    def __init__(self, values):
        self.values = values

    def __add__(self, x):
        return min(self.values, x.values)

    def __mul__(self, x):
        return self.values + x.values

    def Tropical_sum(self):
        return min(self.values)

# INF
INF = float('inf')
Infty = Tropical(INF)

# Tropical Product
def Tropical_Product(A, B):
    return [[(lambda x: Tropical(x).Tropical_sum())(list(map(lambda x: Tropical(x[0]) * Tropical(x[1]), zip(A[i], [[B[j][i] for j in range(len(B))] for i in range(len(B))][j])))) for j in range(len(A))] for i in range(len(B))]

def Tropical_Pow(A, num):
    tmp = A
    B = A
    for _ in range(num-1):
        B = Tropical_Product(B,tmp)
    return B

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

Z = np.full((N,N),INF)
for i in range(N+1):
    for j in range(i+1,i+3):
        #print(i,j)
        if j <= N:
            #print(i,j)
            if abs(i-j)==1 and i+1 < N:
                Z[i][j] = abs(h[i]-h[i+1])
            elif abs(i-j)==2 and i+2 < N:
                Z[i][j] = abs(h[i]-h[i+2])

for i in range(N):
    tmp = Tropical_Pow(Z,i)
    if tmp[0][-1] != INF:
        print(int(tmp[0][-1]))
        exit()

### FIXED CODE ###

def chmin(a, b):
    if a > b:
        return b
    else:
        return a

# input
N = int(input())
h = list(map(int, input().split()))

# dp table
dp = [float('inf')]*(10**5 + 10)

# 初期条件
dp[0] = 0

for i in range(1,N):
    dp[i] = chmin(dp[i], dp[i-1] + abs(h[i] - h[i-1]))
    if i > 1:
        dp[i] = chmin(dp[i], dp[i-2] + abs(h[i] - h[i-2]))

# ans
print(dp[N-1])
w, h, x, y = map(int, input().split())

pattern = 1
if w/2 == x and h/2 == y:
    pettern = 1
elif w/2 == x or h/2 == y:
    pettern = 0

print("{} {}".format(w*h/2, pettern))


### FIXED CODE ###

w, h, x, y = map(int, input().split())

pattern = 0
if w/2 == x and h/2 == y:
    pattern = 1

print("{} {}".format(w*h/2, pattern))