peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a, b, c =map(int, input().split())

ans = "NO"

for i in range(1, b+1):
    if a*i % b == c:
        ans = "YES"
        break

print(ans)
# Judge status: Accepted
x, y, z = map(int, input().split())
X = z
Y = x
Z = y
print(X,Y,Z)
# Judge status: Accepted
def solve():
  N, K = map(int, input().split())
  mod = 10**9+7
  ans = 0
  for k in range(K,N+2):
    ans += (N+N-k+1)*k//2-k*(k-1)//2+1
    ans %= mod
  return ans
print(solve())
# Judge status: Accepted
c = 0
s = f = ""
for i in input():
  s += i
  if s != f:
    c += 1
    s, f = "", s
print(c)
# Judge status: Wrong Answer
sx,sy,tx,ty = map(int,input().rstrip().split(" "))
dx = tx - sx
dy = ty-sy
ans = ""
ans += "U"*dx + "U" * dy
ans += "L" * dx + "D" * dy
ans += "D" + "R" * (dx + 1) + "U" * (dy + 1) + "L"
ans += "U" + "L" * (dx + 1) + "D" * (dy + 1) + "R"
print(ans)
# Judge status: Accepted
k = int(input())
a, b = map(int, input().split())

for i in range(a, b+1):
    if i % k == 0:
        print('OK')
        break
else:
    print('NG')
# Judge status: Wrong Answer
a, b = map(int, input().split())
c = 0
for i in range(a):
    if (i*2) + (a-i)*4 == b:
        c+=1
if c>0:
    print("Yes")
elif a==1 and ((b==2) or (b==4)):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-07-29 16:31:41 +0900
# LastModified: 2020-07-29 16:38:58 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    S = sorted(input())
    T = sorted(input(), reverse=True)
    for s, t in zip(S, T):
        if s < t:
            print("Yes")
            return
    if len(S) < len(T):
        print("Yes")
        return
    print("No")


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n, m = map(int, input().split())

ans = ["#"]*n

for i in range(m):
    s, c = map(int, input().split())
    if ans[s-1] == "#" or ans[s-1] == c:
        ans[s-1] = c
    else:
        print(-1)
        exit()
if ans[0] == "#":
    ans[0] = 1
elif ans[0] == 0:
    print(-1)
    exit()

print("".join(map(str, ans)).replace("#", "0"))
# Judge status: Accepted
k = int(input())
if k % 2 == 0 & k % 5 == 0:
    print(-1)
    exit()

x = 7 % k
s = set()
i = 1
ans = -1
while x not in s:
    if x == 0:
        ans = i
        break
    s.add(x)
    x = (10 * x + 7) % k
    i += 1
    
print(ans)
# Judge status: Accepted
n,k=map(int, input().split())
print(abs((n-2)*(k-2)))
# Judge status: Accepted
A, B= map(int,input().split())
if A < 10 and B < 10:
    print(A*B)
else:
    print(-1)
# Judge status: Accepted
import math

def main():
    a, b, x = map(int, input().split())
    if(x <= (a * a * b) / 2): 
        tan_th = (a * b * b) / (2 * x)
    else:
        tan_th = (2 * (a * a * b - x)) / (a * a * a)
    ans = math.degrees(math.atan(tan_th))
    print(ans)
    return 0
    
if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
print('ABC' if n<=999 else 'ABD')
# Judge status: Accepted
# ABC 168 D
from collections import deque

N,M=map(int,input().split())
G=[[] for _ in [0]*(N+1)]
for _ in [0]*M:
    a,b=map(int,input().split())
    G[a]+=[b]
    G[b]+=[a]

F=[-1]*(N+1)
q=deque()
q.append((1,1))
while q:
    room,par=q.popleft()
    if F[room]>0:
        continue
    F[room]=par
    for nroom in G[room]:
        q.append((nroom,room))
        
print('Yes')
print(*F[2:],sep='\n')
# Judge status: Wrong Answer
from math import ceil

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

if min(A,B,C,D,E) >= N:
    print(5)
else:
    print(5+ceil(N//min(A,B,C,D,E)))
# Judge status: Wrong Answer
n=int(input())
ans=0
for i in range(1,n+1):
    m=n//i*i
    k=n//i
    if k>1:
        #ans+=(i+m)*((m-i+1)//i)//2
        ans+=(k//2)*(2*i+(k-1)*i)
    else:
        ans+=i
print(ans)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, a, b = map(int, readline().split())
if a > b:
    print(0)
elif n == 1:
    if a != b:
        print(0)
    else:
        print(1)
else:
    print(a + b * (n - 1) - (b + a * (n - 1)) + 1)
# Judge status: Wrong Answer
n = int(input())
i = 1
s = []
while n!=0:
    if n%2**i>0:
        s.append('1')
        n -= (-2)**(i-1)
    else:
        s.append('0')
    i += 1
if n==0:
    print('0')
else:
    print(''.join(s[::-1]))
# Judge status: Accepted
s = input()
dict = {'Sunny': 'Cloudy', 'Cloudy':'Rainy', 'Rainy':'Sunny'}
print(dict[s])
# Judge status: Accepted
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    s=readline().strip()
    
    if s=="Sunny":
        print("Cloudy")
    elif s=="Cloudy":
        print("Rainy")
    else:
        print("Sunny")
        
if __name__=="__main__":
    main()
# Judge status: Wrong Answer
N,K=map(int,input().split())
S=input()
print(S[:K-1]+S[K-1]+S[K:N+1])
# Judge status: Accepted
s = input()
print(2*min(s.count("0"),s.count("1")))
# Judge status: Accepted
from collections import Counter

c = Counter(input())

ok = True
for k in c:
    if c[k] != 2:
        ok = False
        break

if ok:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a,b=map(int,input().split());print(a if b>a else a-1)
# Judge status: Accepted
N,D = map(int,input().split())
XY = [list(map(int,input().split())) for _ in range(N)]

ans = 0
for X,Y in XY:
    if X **2 + Y ** 2 <= D ** 2:
        ans += 1
    else:
        continue
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
cnt = [0]*(66)
for num in a:
    for j in range(60):
        cnt[j] += (num >> j)%2
ans = 0
for b in range(60):
    ans += (cnt[b]*(n-cnt[b])) << b
    ans %= 10**9+7
print(ans)
# Judge status: Accepted
import math

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

if abs(N-M)>=2:
    print(0)
elif abs(N-M)==1:
    print((math.factorial(N)*math.factorial(M))%(10**9+7))
else:
    print(((math.factorial(N) * math.factorial(M))*2) % (10 ** 9 + 7))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if a%2==0 or b%2==0 or b%2==0:
    print(0)
else:
  print(a*b*c//min(a,b,c))
# Judge status: Wrong Answer
N = int(input())
List = list(map(int,input().split()))
List_t = []
List_q = []
List.sort()
for x in range(N-1):
  if List[x]==List[x+1]:
    List_t.append(List[x])
for x in range(N-3):
  if List[x]==List[x+1]==List[x+2]==List[x+3]:
    List_q.append(List[x])

if len(List_q) == 0:
  if len(List_t)<=1:
    print(0)
  else:
    M = sorted(set(List_t))[-1]
    m = sorted(set(List_t))[-2]
    print(M*m)
else:
  M = sorted(set(List_q))[-1]
  print(M**2)
# Judge status: Accepted
from collections import defaultdict

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

hoge = defaultdict(int)
for ai in a:
  hoge[ai+1] += 1
  hoge[ai] += 1
  hoge[ai-1] +=1
print(max(hoge.values()))
# Judge status: Accepted
n=int(input())
ans = 0
for i in range(1,n+1,2):
  cnt = 0
  for j in range(1,i+1):
    if i%j == 0:
      cnt += 1
  if cnt == 8:
    ans += 1
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3


def main():
    c = input()
    # i = list(map(int,input().split()))
    # j = list(map(int,input().split()))
    if c == 'a' or c == 'e' or c == 'i' or c == 'o' or c == 'u':
        print('vowel')
    else:
        print('consonant')


main()
# Judge status: Wrong Answer
m=6**6
exec(f'i,j=m%120,m//120;m-=i**5-j**5!={input()}or exit(print(i,j));'*m)
# Judge status: Accepted
x = input()

s, t = 0, 0
for i in x:
    if i == 'S':
        s += 1
    elif i == 'T':
        if s > 0:
            s -= 1
        else:
            t += 1
print(s + t)
# Judge status: Accepted
import re
S = str(input())
res = re.sub("hi","", S)

if res == "":
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def get_ints():
    return map(int, input().split())

x, y, z = get_ints()
print('%d %d %d' % (z, x, y))
# Judge status: Wrong Answer
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
p = p[:X]
q.sort(reverse=True)
q = q[:Y]
r.sort(reverse=True)
ans = p + q
ans.sort()

i = 0
for rr in r:
    if ans[i] < rr:
        ans[i] = rr
    else:
        break

print(sum(ans))
# Judge status: Accepted
a = int(input())
b = int(input())

print(6 - a - b)
# Judge status: Accepted
y, m, d = map(int, input().split("/"))

isHeisei = False
if y <= 2019:
    if m <= 4:
        if d <= 30:
            isHeisei = True
print(["TBD", "Heisei"][isHeisei])
# Judge status: Wrong Answer
N, K = map(int,input(). split())
x = list(map(int,input().split()))
ans = float("inf")
for i in range(N - K + 1):
    if ans > abs(x[i]) + (x[i + K - 1] - x[i]):
        ans = abs(x[i]) + (x[i + K - 1] - x[i])
    if ans > abs(x[i + K - 1]) + (x[i + K - 1] - x[i]):
        ans = abs(x[i]) + (x[i + K - 1] - x[i])
print(ans)
# Judge status: Wrong Answer
# DP practice
# https://atcoder.jp/contests/dp/tasks/dp_a

# 入力方法としてはこれが手軽
N = int(input())
h = list(map(int, input().split()))

dp = list()

# N = 0, 1 の時の処理も必要。だが省く
dp.append(0)
dp.append(dp[0] + abs(h[1] - h[0]))

for i in range(2, N):
	dp.append(min(dp[i-2] + abs(h[i] - h[i-2]), dp[i-1] + abs(h[i] - h[i-1])))


print(dp)
# Judge status: Accepted
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
if max(x) < min(y):
  if X < min(y) <= Y:
    print("No War")
    exit()
print("War")
# Judge status: Accepted
import itertools
N = int(input())
L = list(map(int, input().split()))
Lset= list(set(L))
ans = 0
count = 0

for n in itertools.combinations(Lset, 3):
    if n[0]+n[1]>n[2] and n[1]+n[2]>n[0] and n[2]+n[0]>n[1]:
        ans += 1
        count += ans*L.count(n[0])*L.count(n[1])*L.count(n[2])
        ans = 0
print(count)
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort(reverse=True)

ans = sum(h[k:])
print(ans)
# Judge status: Wrong Answer
dict={}
dict2={}
n,m=map(int,input().split())
for i in range(m):
	p,m=map(int,input().split())
	dict[i]=[p,m]
	if p not in dict2:
		dict2[p]=[m]
	else:
		dict2[p].append(m)
dict2[p].sort()
for d in dict:
	a='{:0=6}'.format(dict[d][0])
	c=(dict2[dict[d][0]]).index(dict[d][1])+1
	c='{:0=6}'.format(c)
	print(a+c)
# Judge status: Accepted
from math import *
def isok(x):
    res=0
    for i in range(N):
        if A[i]<=x:
            continue
        res+=floor(A[i]/x)
    if res<=K:
        return True
    else:
        return False

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

ng,ok=0,10**10

while(ok-ng>1):
    mid=(ok+ng)//2
    if isok(mid):
        ok=mid#最大をmid以下にするのが可能かどうか
    else:
        ng=mid
print(ok)
# Judge status: Accepted
n,d=map(int,input().split())
if n%(2*d+1)==0:
    print(n//(2*d+1))
else:
    print(n//(2*d+1)+1)
# Judge status: Wrong Answer
import sys
A, B, C = list(map(int, input().split()))

i = 1
tmp = A

while i<10000:
  if tmp%B != C:
    i = i+1
    tmp = tmp+ i*A
  else:
    print("YES")
    sys.exit()
print("NO")
# Judge status: Accepted
S = input()
N = len(S) + 1

A = [0] * N

c = 0
for i, si in enumerate(S):
    if si == '<':
        c += 1
    else:
        c = 0
    A[i+1] = c

c = 0
for i in range(len(S)-1, -1, -1):
    if S[i] == '>':
        c += 1
    else:
        c = 0
    A[i] = max(A[i], c)

# print(A)
print(sum(A))
# Judge status: Accepted
L=list(map(int,input().split()))
X,K,D = abs(L[0]),L[1],L[2]
Y = X-K*D
W = (K-X//D)%2
if Y >= 0:
    Z = Y
elif Y < 0:
    if W == 1:
        Z = D - X % D
    else:
        Z = X % D
print(Z)
# Judge status: Accepted
a=[int(input())]
for i in range(1,1000000):
    if a[i-1]%2==0:
        a.append(a[i-1]/2)
    else:
        a.append(a[i-1]*3+1)
    if a.count(a[i])==2:
        break
print(i+1)
# Judge status: Accepted
if __name__ == '__main__':
    L = int(input())
    side = L / 3
    print(side ** 3)
# Judge status: Wrong Answer
a= list(map(int, input().split()))

x = a[0]
y = a[1]

n = 2
if x >= y:
    print(1)
else:
   while ((x - 1) * n) + 1 < y:
        n += 1

print(n)
# Judge status: Accepted
q,h,s,d = map(int,input().split())
n = int(input())

z = min(q*4,h*2,s)

if n % 2 != 0:
    print(min((n//2)*d+z,n*z))
else:
    print(min((n//2)*d,n*z))
# Judge status: Accepted
n=int(input())
i=0
while 2**i <= n:
    i += 1
print(2**(i-1))
# Judge status: Accepted
n, q = map(int, input().split())
s = input()

ac = [0] * n

for i in range(1, n):
        if s[i-1:i+1]=="AC": ac[i] = 1
        ac[i] += ac[i-1]

for i in range(q):
        l, r = map(int, input().split())
        print(ac[r-1] - ac[l-1])
# Judge status: Accepted
N=int(input())
ans=(N-N//2)/N
print(ans)
# Judge status: Accepted
from fractions import gcd

n, m = map(int, input().split())
a = list(map(int, input().split()))
b = [a[i]//2 for i in range(n)]
lcm_a = 1
for i in range(n):
    lcm_a = (lcm_a * b[i]) // gcd(lcm_a, b[i])
for i in range(n):
    if (lcm_a//b[i]) % 2 == 0:
        print(0)
        exit()
if m < lcm_a:
    print(0)
else:
    m -= lcm_a
    print(1 + m // (lcm_a*2))
# Judge status: Accepted
x = int(input())

s = x//11

cnt = s*2

x -= s*11

if x == 0:
    pass
elif x <= 6:
    cnt += 1
elif x < 11:
    cnt += 2
else:
    print('error')

print(cnt)
# Judge status: Accepted
K=int(input())
S=input()

if (len(S)<=K):
    print(S)
else:
    print(S[0:K]+"...")
# Judge status: Accepted
A,B = map(int,input().split())
print((A+B)%24)
# Judge status: Accepted
import heapq

N,M=input().split()
N,M=int(N),int(M)
A=input().split()
A=[-int(n) for n in A]

heapq.heapify(A)

for i in range(M):
    a=((-1*heapq.heappop(A))//2)*(-1)
    heapq.heappush(A,a)
sum=0
for i in range(N):
    sum+=A[i]
print(-sum)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

calc = []
for i in range(n):
    calc.append(A[i] - (i + 1))

calc.sort()

b = calc[n // 2]

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

print(ans)
# Judge status: Accepted
x = int(input())

if x%11==0:
    print((x//11)*2)
elif x%11<=6:
    print((x//11)*2+1)
else:
    print((x//11)*2+2)
# Judge status: Accepted
A, B = list(map(int, input().split())) 

if A+B >= 24:
  print(A+B-24)
else:
  print(A+B)
# Judge status: Accepted
N,C,K=map(int, input().split())
T=[]
for i in range(N):
    t=int(input())
    T.append(t)

T=sorted(T)
ans=0
mint=T[0]
now=1
for i in range(1,N):
    t=T[i]
    if now==C:
        ans+=1
        now=1
        mint=t
    elif t-mint<=K:
        now+=1
    else:
        ans+=1
        now=1
        mint=t
    if i==N-1:
        ans+=1
print(ans)
# Judge status: Wrong Answer
n = int(input())
num = list(map(int,input().split()))
# print(type(num[0]))
cnt = 0
for i in range(2,n+1,2):
    if(abs(num[i-1]) % 2 != 0):
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.sort()
b.sort()
ans = 'Yes'
for i in range(n):
    if a[i] > b[i]:
        ans = 'No'
print(ans)
# Judge status: Accepted
import sys
n= int(input())
A=list(map(int, str(n)))
s=0
b=len(A)
for i in range(b):
    s=s+A[i]%9
if s%9==0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
# 1000回目から1998回目のコンテストを順に ABD001,ABD002,...,ABD999

N = int(input())

if N < 1000:
    print('ABC')

if N >= 1001:
    print('ABD')
# Judge status: Accepted
n = int(input())
a,b,c=0,0,0
for i in range(n):
    t,x,y = map(int, input().split())
    sa = t-a
    if sa<abs(x-b)+abs(y-c):
        print("No")
        exit()
    else:
        tw = sa-abs(x-b)-abs(y-c)
        if tw%2!=0:
            print("No")
            exit()
    a,b,c=t,x,y
print("Yes")
# Judge status: Wrong Answer
N = int(input())
 
print(N % 1000)
# Judge status: Accepted
import collections
s = str(input())

c = list(collections.Counter(s).values())
c.sort(reverse=True)

#print(c)
if len(c) <= 2:
    if c[0] >= 2:
        print('NO')
    else:
        print('YES')

else:
    if abs(c[0]-c[1]) >= 2 or abs(c[1]-c[2]) >= 2 or abs(c[2]-c[0]) >= 2:
        print('NO')
    else:
        print('YES')
# Judge status: Accepted
import math
n=int(input())

print(2**math.floor(math.log2(n)))
# Judge status: Wrong Answer
import sys
from collections import Counter

inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()

if not ("N" in s and "S" in s):
    print("No")

if not ("E" in s and "W" in s):
    print("No")
# Judge status: Accepted
A,B,T=map(int,input().split())
import math
X=math.floor((T+0.5)/A)
print(X*B)
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-*-

from sys import stdin


def main():
    N, M = map(int, stdin.readline().split())
    A = list(map(int, stdin.readline().split()))
    j = sum(A) / (4 * M)
    cnt = 0
    for a in A:
        if a >= j:
            cnt += 1
            if cnt == M:
                print('Yes')
                return
    print('No')


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
N = int(input())
ans = 0
if N%2==0:
  print("0")
else:
  for num in range(1,N+1):
    cnt = 0
    for i in range(1,num):
      if num%i == 0:
        cnt = cnt+1
      
    if cnt == 8:
      ans = ans+1


print(ans)
# Judge status: Accepted
X, Y = map(int, input().split())
if X%Y == 0:
  print(-1)
else:
  print(X)
# Judge status: Accepted
a = input()
b = input()
print("YES" if a[::-1]==b else "NO")
# Judge status: Wrong Answer
N = int(input())
alpha = 'abcdefghijklmnopqrstuvwxyz'

cnt = 0
for i in range(N):
    ans = ''
    for j in range(N - 1):
        ans += alpha[0]
    ans += alpha[cnt]
    cnt += 1
    print(ans)
# Judge status: Accepted
def solve():
    N, M = map(int, input().split())
    contains_redball = [False] * N
    contains_redball[0] = True
    balls_cnt = [1] * N
    for _ in range(M):
        x, y = map(int, input().split())
        x, y = x - 1, y - 1
        balls_cnt[x] -= 1
        balls_cnt[y] += 1
        if contains_redball[x]:
            contains_redball[y] = True
        if balls_cnt[x] == 0:
            contains_redball[x] = False
    print(sum(contains_redball))

if __name__ == '__main__':
    solve()
# Judge status: Accepted
# A - 高橋君とホテルイージー
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
sum=0
N_count=N
K_count=K

while( (N_count>0) & (K_count>0) ):
    N_count-=1
    K_count-=1
    sum+=X
while( (N_count>0) & (K_count==0) ):
    N_count-=1
    sum+=Y
print(sum)
# Judge status: Wrong Answer
N,A,B,C,D=map(int,input().split())
S="*"+input()

X=[0]*(N+1)
Y=[0]*(N+1)

for k in range(1,N+1):
    if S[k]=="#":
        X[k]=X[k-1]+1
    else:
        Y[k]=Y[k-1]+1

if max(X[A:max(C,D)+1])>=3:
    print("No")
else:
    if C<D:
        print("Yes")
    elif C>D and max(Y[B:D+1])>=3:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
N, K = map(int,input().split())
H = list(map(int,input().split()))

#DP[i] i番目までの足場を見たときの足場iにたどり着く最小値

DP = [10**12 for _ in range(N + 1)] 
DP[0] = 0
for i in range(N):
    for k in range(1,K + 1):
        if 0 <= i - k and i - k < N:
            cost_min = 10**12
            cost_min = min(cost_min, DP[i - k] +  abs(H[i] - H[i - k]))
            DP[i] = min(DP[i],cost_min)
print(DP[N - 1])
# Judge status: Accepted
n=list(input())
if "7" in n:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
K=int(input())
A,B=map(int,input().split())
for i in range(A,B+1):
  if i%K==0:
    print("OK")
    break
else:
  print("NG")
# Judge status: Accepted
n = int(input())
A = list("abcdefghijklmnopqrstuvwxyz")
B = [50]*26
for i in range(n):
    C = [0]*26
    s = input()
    s = sorted(s)
    for j in range(len(s)):
        for k in range(26):
            if s[j] == A[k]:
                C[k] += 1
                break
    for m in range(26):
        B[m] = min(B[m],C[m])

D = [] 
for i in range(26):
    D.append(A[i]*B[i])
D.sort()
print(*D, sep = "")
# Judge status: Accepted
s,t=input().split()
a,b=map(int,input().split())
u=input()
if s==u:
    print(a-1,b)
else:
    print(a,b-1)
# Judge status: Wrong Answer
# これ灰difじゃないか？
# 各マス偶数回なら表 奇数回なら裏 -> 角は偶数回（4回）だし縁も偶数回（6回）だけどソレ以外は9回
n, m = map(int, input().split())
if n == 1 or m == 1:
    print(max(n, m) - 2)
else:
    print(n * m - (n * 2 + (m - 2) * 2))
# Judge status: Wrong Answer
n = int(input())
ans = (n-1)*n*0.5
print(int(ans))
# Judge status: Wrong Answer
import numpy as np

n = int(input())
t, a = map(int,input().split())
li = list(map(int, input().split())) #数値

t = t*1000
npli = np.array(li)
npli = t-npli*6

res = npli[0]
res_num = 1
for i in range(n):
    print(abs(res), abs(npli[i]))
    if abs(a) - abs(res) > abs(a) - abs(npli[i]):
        res = npli[i]
        res_num = i+1
print(res_num)
# Judge status: Wrong Answer
n,x,y=map(int,input().split())
s= input()
c=0
d=x+y
f= False
for i in range(n):
    if s[i]=="a":
        if c<d:
            f=True
    elif s[i]=="b":
        if c<d and c<=y:
            f=True
    if f:
        print("YES")
        c+=1
    else:
        print("NO")
    f=False
# Judge status: Wrong Answer
s=input()
n=len(s)
ans=[0]*(n+1)
  
for i in range(0,n):
  if s[i]=='<':
    ans[i+1]=ans[i]+1
for i in range(n-1,-1,-1):
  if s[i]=='>':
    ans[i]=max(ans[i+1]+1,ans[i])
print(ans)
print(sum(ans))
# Judge status: Wrong Answer
a, b = map(int, input().split())
s = input()
print("Yes" if s[a] == "-" and s[:a].isdigit() and s[b:].isdigit() else "No")
# Judge status: Accepted
s = input()
ans = []
for i in s:
    if i == "0" or i == "1":
        ans.append(i)
    elif ans != []:
        ans.pop(-1)
print("".join(ans))
# Judge status: Accepted
def ranksum(x):
    return sum([int(i) for i in str(x)])

n = int(input())

ans = 10 ** 6
for i in range(1, n):
    a, b = i, n - i
    ans = min(ans, ranksum(a) + ranksum(b))

print(ans)
# Judge status: Accepted
import numpy as np
N, K = map(int, input().split(" "))

i = 1
while K ** i <= N:
    i += 1
else:
    print(i)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

add = dict()
sub = dict()
for i, ai in enumerate(a):
    if i+ai in add.keys():
        add[i+ai] += 1
    else:
        add[i+ai] = 1
    if i-ai in sub.keys():
        add[i-ai] += 1
    else:
        add[i-ai] = 1

cnt = 0
for ak, av in add.items():
    if ak not in sub.keys(): continue
    cnt += av*sub[ak]

print(cnt)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
print('YES' if b == int((a+c)/2) else 'NO')
# Judge status: Accepted
x=int(input())
if x==3 or x==5 or x==7:print("YES")
else:print("NO")
# Judge status: Accepted
N = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)

A = 0
B = 0
for i in range(N):
    if i % 2 == 0:
        A += l[i]
    else:
        B += l[i]

print(A - B)
# Judge status: Wrong Answer
n = int(input())
ans = [0]

for i in range(1, n):
	if i * i <= n:
		ans.append(i*i)
	elif i * i > n:
		print(max(ans))
		exit()


print(max(ans))
# Judge status: Accepted
x = int(input())
if x <= 6:
    print(1)
elif x % 11 == 0:
    print((x // 11)*2)
elif x % 11 <= 6:
    print((x // 11)*2 + 1)
else:
    print((x // 11)*2 + 2)
# Judge status: Wrong Answer
k,a,b=map(int,input().split())

ans=(b-a)*(k//(a+1))+(k-k//(a+1)) if k>=a+1 else 1+k
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

cs = [0]*9
for a in A:
    if a >= 3200:
        cs[-1] += 1
    else:
        cs[a//400] += 1
mn = len([1 for c in cs[:-1] if c>0])
if mn==0:
    print(1,N)
else:
    print(mn,mn+cs[-1])
# Judge status: Accepted
import sys

def encode(n:int) -> str:
  if n == 0:
      return '0'

  if n == 1:
      return '1'

  if n % 2 == 1:
      ans = '{}1'.format(encode((n-1) // (-2)))
      sys.stderr.write('{} for {}'.format(ans, n))
      sys.stderr.write('\n')
      return ans

  if n % 2 == 0:
      ans = '{}0'.format(encode(n // (-2)))
      sys.stderr.write('{} for {}'.format(ans, n))
      sys.stderr.write('\n')

      return ans

n = int(input())
ans = encode(n)
print(ans)
# Judge status: Wrong Answer
s = 0
i = 1
while i <= 100:
  s = s + i
  i += 1
print(s)
# Judge status: Accepted
a = input().split()
a = a[::-1]
a = ''.join(a)
print(a)
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))
print(-(-(n-1)//(k-1)))