peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
#!/usr/bin/env python3
import sys


def solve(A: int, B: int):
    print(A*B)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
# from pprint import pprint
import math

# import collections

n = int(input())


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


def f(a, b):
    return max(math.ceil(math.log10(a)), math.ceil(math.log10(b)))


a = 1
ans = 11
while a <= math.sqrt(n):
    if n % a == 0:
        b = n // a
        if n % a == 0 and f(a, b) <= ans:
            ans = f(a, b)
    a += 1

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

if n == 10 or n == 100 or n == 1000 or n == 10000 or n == 100000:
    ans = 10
else:
    n = str(n)
    ans = 0
    for l in n:
        ans += int(l)

print(ans)
# Judge status: Accepted
import sys
N,M,X,Y = map(int,input().split())
x =  list(map(int,input().split()))
y =  list(map(int,input().split()))

for Z in range(X+1,Y+1):
    if max(x) < Z and Z <= min(y):
        print("No War")
        sys.exit()
print('War')
# Judge status: Accepted
from collections import defaultdict
S = input()
T = input()
d = defaultdict(set)
for s, t in zip(S, T):
    d[s].add(t)

for v in d.values():
    if len(v) != 1:
        print("No")
        exit()

chars = set()
for k, v in d.items():
    for x in v:
        if x in chars:
            print("No")
            exit()
        chars.add(x)
print("Yes")
# Judge status: Accepted
a,b,c,d=map(int, input().split())
start=max(a,c)
finish=min(b,d)
if start<finish:
  print(finish-start)
else:
  print("0")
# Judge status: Wrong Answer
n = int(input())

if n <= 9:
    print(n)
if 10 < n <= 99:
    print(9)
if 100 <= n <=999:
    print(n%100+1+9)
if 1000 <= n <= 9999 :
    print(900+9)
if 10000 <= n <= 99999:
    print(n%10000+900+9)
if n == 100000:
    print(90909)
# Judge status: Accepted
a,b,c,d=map(int,input().split())

xy=[a*c,a*d,b*c,b*d]
print(max(xy))
# Judge status: Accepted
n = int(input())
a = [int(e) for e in input().split()]
ans = float("inf")
MIN, MAX = min(a), max(a)
for i in range(MIN, MAX+1):
    cost = 0
    for j in a:
        cost = cost + (i-j)**2
    ans = min(ans, cost)
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
import sys

def main():
    N, M, K = map(int, input().split())
    for i in range(N+1):
        a = K - i * M
        b = N - 2*i
        if b == 0:
            if K == i*M:
                print('Yes')
                exit()
        elif a % b == 0 and 0 <= a // b <= M:
            print('Yes')
            exit()
    print('No')
            

if __name__ == '__main__':
    main()
# Judge status: Accepted
# -*- coding: utf-8 -*-

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

ans=0
while True:
    for i in range(n):
        if a[i]%2==1:
            break
        a[i]=int(a[i]/2)
    else:
        ans+=1
        continue
    break
print(ans)
# Judge status: Wrong Answer
N = int(input())
S = input()

result =[]

for i in range(N):
    left = []
    right= []
    for l in range(0,i):
        if S[l] not in left:
            left.append(S[l])
        else:
            continue
    for r in range(i,N):
        if S[r] not in right:
             right.append(S[r])
        else:
            continue

    if len(left)>=len(right):
        result.append(len(right))
    else:
        result.append(len(left))


print(max(result))
# Judge status: Accepted
N, x = map(int, input().split())
A = list(map(int, input().split()))

B = [A[0]]
for i in range(N-1):
    B.append(A[i] + A[i+1])
B.append(A[-1])

ans = 0
for i in range(N+1):
    if B[i] > x:
        a = B[i] - x
        ans += a
        B[i] -= a
        if i < N:
            B[i+1] -= a
print(ans)
# Judge status: Accepted
N = int(input())
L = list(sorted(map(int, input().split())))
if sum(L[:-1]) > L[-1]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
X,Y = map(int,input().split())

ans = 1
tmp = X

while tmp <= Y:
    tmp = tmp*2
    if tmp <= Y:
        ans+=1

print(ans)
# Judge status: Accepted
a_list = list(map(int, input().split()))

ans = "Impossible"

if sum(a_list) % 3 == 0 \
	or a_list[0] % 3 == 0 \
  	or a_list[1] % 3 == 0:
      ans = "Possible"
      
print(ans)
# Judge status: Accepted
n = int(input())
INF = 10**12
param = []
for i in range(n):
    a, b, c = map(int, input().split())
    param.append([a, b, c])

dp = [[-INF] * 3 for i in range(n + 1)]
dp[0][0] = 0
dp[0][1] = 0
dp[0][2] = 0

for i in range(n):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue

            dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + param[i][k])
print(max(dp[-1][0], dp[-1][1], dp[-1][2]))
# Judge status: Accepted
s = input()
ans = ""

for i in s:
    if i == "B":
        if not ans == "":
            ans = ans[:-1]
    else:
        ans = ans + i

print(ans)
# Judge status: Wrong Answer
x = int(input())
ans = x // 11 * 2


if  x % 11 <= 6 and x % 11 != 0:
    ans += 1
else:
    ans += 2

print(ans)
# Judge status: Accepted
o = str(input())
e = str(input())
lst = []

if len(o)==len(e):
    for i in range(len(o)):
        lst.append(o[i])
        lst.append(e[i])
    print(''.join(lst))
else:
    for i in range(len(e)):
        lst.append(o[i])
        lst.append(e[i])
    lst.append(o[-1])
    print(''.join(lst))
# Judge status: Accepted
N = int(input())
L = list(map(int, input().split()))

count = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        for k in range(j+1, N):
            x = max(L[i], L[j], L[k])
            y = L[i] + L[j] + L[k]
            if x < y - x and (L[i] != L[j] and L[i] != L[k] and L[j] != L[k]):
                count += 1

print(count)
# Judge status: Accepted
def main():
    N = int(input())
    tasks = list()
    for _ in range(N):
        A, B = list(map(int, input().split(' ')))
        tasks.append((B, A))
    tasks.sort()
    current = 0
    for t in tasks:
        dead_line_time, required_time = t
        if current + required_time > dead_line_time:
            print('No')
            exit(0)
        current += required_time
    print('Yes')


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
s = input()
x=0
max=0
for i in range(n):
    if s[i]=="I":
        x += 1
    else:
        x -= 1
    if x > max:
        max = x
print(max)
# Judge status: Accepted
N = int(input())

success = 0
for four in range(0, 26):
    for seven in range(0, 14):
        if four * 4 + seven * 7 == N:
            success = 1
if success:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
C=input()

ls=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

print(ls[ls.index(C)+1])
# Judge status: Accepted
# https://atcoder.jp/contests/abc061/tasks/abc061_c
import sys

def main():
    n, k = map(int, input().split())
    ans = [0 for _ in range(10**5+1)]
    for x in sys.stdin.readlines():
        a, b = map(int, x.split())
        ans[a] += b

    cnt = 0
    for i in range(10**5+1):
        cnt += ans[i]
        if cnt >= k:
            print(i)
            exit()

if __name__ == "__main__":
    main()
# Judge status: Accepted

def main():
  n = int(input())
  count = 0

  for i in range(n):
    a, b = map(int, input().split())
    if a == b:
      count += 1
    else:
      count = 0

    if count >= 3:
      print("Yes")
      return

  print("No")

main()
# Judge status: Accepted
# -*- coding: utf-8 -*-
import numpy as np
def fnSolv():
  iNum, iK = map(int, input().split())
  naHn  = np.array(list(map(int, input().split())))
  naDP  = np.zeros(iNum, dtype='int64')
  naLen = np.ones(iK) * 10**9
  for iI0 in range(1, iNum):
    iK0 = min([iK, iI0])
    naLen = naDP[iI0-iK0:iI0] + np.abs(- naHn[iI0-iK0:iI0] + naHn[iI0])
    naDP[iI0] = naLen.min()
  print(naDP[iNum-1])

if __name__ == '__main__':
  fnSolv()
# Judge status: Wrong Answer
from math import log2
x, y = [int(s) for s in input().split()]
print(int(log2(y / x)) + 1)
# Judge status: Accepted
k = int(input())
if k <= 9:
    print(k)
    exit()
a = [i for i in range(1, 10)]
cnt = 9
idx = 0
while cnt < k:
    a_ = str(a[idx])
    t = a_[-1]
    if t == "0":
        l_ = [0, 1]
    elif t == "9":
        l_ = [8, 9]
    else:
        l_ = [int(t)-1, int(t), int(t)+1]
    for i in l_:
        a.append(int(a_ + str(i)))
    cnt += len(l_)
    idx += 1
print(a[-(cnt-k+1)])
# Judge status: Wrong Answer
syoki_str = input()
syori_cnt = int(input())

result = ""
for i in range(syori_cnt):
    line = input().split(" ")
    if line[0] == "1":
        result = ''.join(list(reversed(syoki_str)))
    else:
        output = []
        if line[1] == "1":
            output.append(line[2])
            output.append(syoki_str)
        else:
            output.append(syoki_str)
            output.append(line[2])
        result = ''.join(output)

print(result)
# Judge status: Wrong Answer
def main():
    n = int(input())
    S = input()

    array = [0,S.count('E')]
    ans = sum(array)

    for i in range(1,len(S)):
        if S[i-1]=='W':
            array[0]+=1
        if S[i]=='E':
            array[1]-=1
        ans = min(ans, sum(array))
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
x,y=map(int,input().split())
ans=abs(y)-abs(x)
if x*y<0:ans=abs(ans)+1
if x*y==0:
  if x<y:ans=y-x
  elif x>y:ans=abs(ans)+1
elif ans>0:
  if x<0 and y<0:ans+=2
elif ans<0:
  if x>0 and y>0:ans=abs(ans)+2
  else:ans=abs(ans)
print(ans)
# Judge status: Wrong Answer
import fractions
from functools import reduce
import sys
sys.setrecursionlimit(10**9)
mod = 10**9+7
N = int(input())
A = list(map(int,input().split()))
def lcm_base(x, y):
    return x * y * pow(fractions.gcd(x, y), mod-2, mod)%mod
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
value = lcm_list(A)
ans = 0
for i in range(N):
    ans += value*pow(A[i], mod-2, mod)%mod
print(ans%mod)
# Judge status: Accepted
N=int(input())
ans=N
for i in range(N+1):
    count=0
    t=i
    while t>0:
        count+=t%6
        t//=6
    t=N-i
    while t>0:
        count+=t%9
        t//=9
    ans=min(ans,count)
print(ans)
# Judge status: Wrong Answer
N,M=map(int,input().split())

dp=[0]*(N+1)
dp[0]=1
for _ in range(M):
    a=int(input())
    dp[a]=-1

for i in range(1,N+1):
    if dp[i]==-1:
        continue
    if dp[i-1]!=-1:
        dp[i]+=dp[i-1]
    if dp[i-2]!=-1:
        dp[i]+=dp[i-2]

if dp[-1]==-1:
    print(0)
else:
    print(dp[-1]%(10**9+7))
# Judge status: Accepted
import math

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

short_x = data[0] * math.cos(math.radians(360 * (60 * data[2] + data[3]) /720))
short_y = data[0] * math.sin(math.radians(360 * (60 * data[2] + data[3]) /720))

long_x = data[1] * math.cos(math.radians(360 * (data[3]) / 60))
long_y = data[1] * math.sin(math.radians(360 * (data[3]) / 60))

print( math.sqrt((short_x - long_x) * (short_x - long_x) + (short_y - long_y) * (short_y - long_y)))
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]

next = 1
ans = 0
found = False
for i in range(N):
    if A[i] == next:
        next += 1
        found = True
    else:
        ans += 1

if found:
    print(ans)
else:
    print(-1)
# Judge status: Accepted
# coding: utf-8

s = list(map(int, input().split(" ")))

snk = s[0]
oks = s[1]

v = []
for i in range(oks) :
    num = int(input())
    x = list(map(int, input().split(" ")))
    for j in range(num) :
        v.append(x[j])

ans = snk - len(set(v))

print(ans)
# Judge status: Wrong Answer
points = [map(int, raw_input().split(' ')) for _ in range(int(raw_input()))]
print points
def distance(u,v):
	return ((u[1] - v[1]) ** 2 + (u[0] - v[0]) ** 2) ** 0.5
c = [0,0]
def permut(i, points, c):
	if i == len(points):
		tot = 0
		for u,v in zip(points, points[1:]): tot += distance(u,v)
		c[0] +=  tot
		c[1] += 1
		return 
	for j in range(i,len(points)):
		points[i], points[j] = points[j], points[i]
		permut(i+1, points,c)
		points[i], points[j] = points[j], points[i]

permut(0, points,c)

print c[0] / float(c[1])
# Judge status: Accepted
n, k = map(int, input().split())

s = input()

if s[k-1] == 'A':
    t = 'a'
elif s[k-1] == 'B':
    t = 'b'
elif s[k-1] == 'C':
    t = 'c'

s = s[:k-1] + t + s[k:]

print(s)
# Judge status: Accepted
X = int(input())
if X >= 30:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
S = input()

num_r, num_g = S.count('R'), S.count('G')
num_b = N - num_r - num_g
max_ans = num_r * num_g * num_b
count_not_ans = 0
S = list(S)

for i in range(N):
    for j in range(i+1, N):
        k = 2 * j - i
        if (0 <= k <= N-1) and len(set([S[i], S[j], S[k]])) == 3:
            count_not_ans += 1

print(max_ans - count_not_ans)
# Judge status: Accepted
s = list(str(input()))
f = 0
ans = ""
first = s.index("A")
last = s.index("Z")
for i in range(len(s)):
    if s[i] == "Z":
        last = i
print(last - first + 1)
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Sat May  9 23:33:40 2020

@author: shinba
"""

q,h,s,d = map(int,input().split())

n = int(input())

a = [4*q,2*h,s,d/2]

a.sort()

if a[0] != d/2:
    print(int(n*a[0]))

else:
    if n % 2 == 0:
        print(d*int(n/2))
    else:
        print(d*int(n/2)+int(a[1]))
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
M = max(a, b)
m = min(a, b)
if (c%M)%m == 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N = int(input())
As = [int(s) - 1 for s in input().split()]

Cs = [0 for _ in range(N)]
for A in As:
    Cs[A] += 1

a = [C * (C - 1) // 2 for C in Cs]
b = [(C - 1) * (C - 2) // 2 for C in Cs]

S = sum(a)

for A in As:
    print(S - a[A] + b[A])
# Judge status: Accepted
a = str(input())

if a.isupper():
    print('A')
else:
    print('a')
# Judge status: Accepted
x,k,d = map(int,input().split())
x = abs(x)
q,mod = divmod(x,d)
if k <= q:
    ans = x - k*d
else:
    ans = mod
    ans -= (k-q)%2*d
print(abs(ans))
# Judge status: Accepted
s = input()
k = int(input())

ans = '1'

if s.count('1') == len(s) or k == 1 and s[k-1] == '1':
    print(1)
else:
    for i in range(k):
        if s[i] != '1':
            ans = s[i]
            break
    print(ans)
# Judge status: Wrong Answer
n,k=map(int,input().split())
a=list(map(int,input().split()))

edge=[0]*n

for i in range(n):
    edge[i]=a[i]

now=1
to=0
t=k
l=[]
line=0
while t!=0:
    to=edge[now-1]
    t-=1
    if to in l:
        break
    else:
        l.append(to)
        line+=1
    now=to

if t==0:
    print(l[-1])
o=l.index(to)
x=line-o
y=o
cnt=(k-y)%x
print(l[y+cnt-1])
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print(max(c,b//a))
# Judge status: Accepted
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    n, a, b = geta(int)

    if (b - a) & 1 == 0:
        print((b - a) // 2)
    else:
        print(min((a + b - 1) // 2, n - (a + b - 1) // 2))


if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
ans = n*(n-1)//2
print(ans)
# Judge status: Wrong Answer
n = int(input());
arr = list(map(int, input().split()));
count = 0;
for x in range(0, max(arr)):
  arc_arr = list(filter(lambda target: target >= x, arr));
  if len(arc_arr) == n - len(arc_arr): count += 1;
print(count);
# Judge status: Wrong Answer
# input
S = input()
x, y = S[:2], S[2:]

# check
not_YY_x = (int(x) >= 13)
not_YY_y = (int(y) >= 13)
zero_x = (x == "00")
zero_y = (y == "00")
checker = [not_YY_x, not_YY_y, zero_x, zero_y]

if checker == [True, False, False, False]:
    print("YYMM")
elif checker == [False, True, False, False]:
    print("MMYY")
elif checker == [False, False, False, False]:
    print("AMBIGUOUS")
else:
    print("NA")
# Judge status: Accepted
n,m = map(int,input().split())

if n>1:
    uraN=n-2
else:
    uraN=1
    
if m>1:
    uraM=m-2
else:
    uraM=1
    
print(uraN*uraM)
# Judge status: Wrong Answer
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
import numpy as np

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

ruisekiwa = []

for i in range(0, N-1):
    ruisekiwa.append(Hs[i] - Hs[i+1])

checkList = []

for i in ruisekiwa:
    x = 1 if i >= 0 else 0
    checkList.append(x)
checkList.append(0)
checkList.insert(0,0)

checkArray = np.array(checkList)
ans = np.diff(np.nonzero(checkArray == 0)[0]) - 1

print(max(ans))
# Judge status: Accepted
n, k = map(int, input().split())
d = list(input().split())
num = [str(i) for i in range(10)]
for i in range(k):
    num.remove(d[i])
    
import itertools
ans = []
for i in itertools.product(num, repeat=len(str(n))):
    s = int(''.join(i))
    if s >= n:
        ans.append(s)
        
if len(ans) == 0:
    for i in itertools.product(num, repeat=len(str(n)) + 1):
        s = int(''.join(i))
        if s >= n:
            ans.append(s)
    print(min(ans))
    
else:
  print(min(ans))
# Judge status: Wrong Answer
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
x, y = map(int, input().split())
if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
a, b = map(int, input().split())

if a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:
	print("Possible")
else:
	print("Impossible")
# Judge status: Accepted
N = int(input())
X = list(map(int,input().split()))

def damage_all(X,P):
  damage = 0
  for i in X:
    damage += (i - P)**2
  return damage

P = round(sum(X) / len(X))
distance = damage_all(X,P)

print(distance)
# Judge status: Accepted
n , m = map(int, input().split())
N=1000000007
def fac(a):
    ans = 1
    while a>1:
        ans=ans*a%N
        a-=1
    return ans

if abs(n-m)==1:
    ans = fac(n)*fac(m)%N
elif n == m:
    ans = fac(n)*fac(m)*2%N
else:
    ans = 0
print(ans)
# Judge status: Wrong Answer
#coding:utf-8
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
ans = 0
for it in c.items():
    if it[0] <= it[1]:
        ans += (it[1]-it[0])
    else:
        ans += it[0]
print (ans)
# Judge status: Wrong Answer
N = int(input())
Plan = [list(map(int,input().split())) for _ in range(N-1)]

for i in range(N-1):
    c1,s1,f1 = Plan[i]
    time = s1+c1
    for j in range(i+1,N-1):
        c,s,f = Plan[j]
        if s <= time:
            amari = (time-s)%f
            time += amari+c
        else:
            time = s+c
    print(time)
print(0)
# Judge status: Accepted
n,k,s = map(int,input().split())
ans = []
for i in range(k):
    ans.append(s)
if s == 10**9:
    a = 1
else:
    a = s+1
for i in range(n-len(ans)):
    ans.append(a)
print(*ans)
# Judge status: Accepted
K,A,B = map(int,input().split())

if B-A < 3:
    print(K+1)
else:
    if A > K-1:
        print(K+1)
    else:
        count = K-A+1
        shou = count//2
        if count%2 == 1:
            print(A+(B-A)*shou+1)
        else:
            print(A+(B-A)*shou)
# Judge status: Accepted
N,M = map(int,input().split())
L = [0] * (M)
R = [0] * (M)
for i in range(M):
    L[i],R[i] = map(int,input().split())
l = max(L)
r = min(R)

if l <= r:
    ans = r-l+1
else:
    ans = 0

print(ans)
# Judge status: Accepted
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if v*t + a >= w*t + b and a < b:
    print("YES")
elif -v*t + a <= -w*t + b and a > b:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
f,b = input().split()
print(b+f)
# Judge status: Accepted
isu, hito, sukima =  map(int, input().split())

ninzuu = 0
while True:
  ans = isu // ((hito + sukima) * ninzuu + sukima)
  if ans == 0:
    break
  ninzuu = ninzuu + 1
print(ninzuu-1)
# Judge status: Accepted
def mainFunc():
    a, b = list(map(int, input().split(" ")))
    if a <= b:
        mn = a
        mx = b
    else:
        mn = b
        mx = a
    
    ans = ""
    for i in range(mx):
        ans += str(mn)
    
    print(ans)

mainFunc()
# Judge status: Accepted
N,K=map(int,input().split())
h_list=list(map(int,input().split()))
dp=[0]*N
for i in range(1,N):
    dp[i]=float("inf")
    for j in range(1,min(i,K)+1):
        dp[i]=min(dp[i],dp[i-j]+abs(h_list[i-j]-h_list[i]))
print(dp[-1])
# Judge status: Accepted
a,b,c,k=map(int,input().split())
print((-1)**k*(a-b))
# Judge status: Accepted
n,k=list(map(int,input().split()))
m=list(map(int,input().split()))
import math
def pos(h):
    p=0
    for i in range(n):
        p+=math.ceil(m[i]/h)-1
    return bool(p<=k)
l,r=1,max(m)
while l<r:
    mid=(l+r)//2
    if pos(mid):
        r=mid
    else:
        l=mid+1
print(l)
# Judge status: Wrong Answer
n,m,x,y = map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
X.sort()
Y.sort()
if X[n-1] < Y[0] and x < y:
    print('No War')
else:
    print('War')
# Judge status: Accepted
k,x=map(int,input().split())
l=max(-1000000,x-k+1)

for i in range(l,l+k*2-1):
  print(i, end=' ')
# Judge status: Wrong Answer
N = int(input())
for i in range(N):
  if 2**i < N:
    pass
  else:
    print(2**(i-1))
    break
# Judge status: Wrong Answer
n, k = map(int, input().split())
s = input()
t = s.replace(s[k-1], s[k-1].lower())
print(t)
# Judge status: Wrong Answer
n = int(input())
w = [input() for _ in range(n)]

flag=True
if len(set(w))!=n:
    flag=False
    
for i in range(n-1):
    print(flag)
    if w[i][-1]!=w[i+1][0]:
        flag=False

print("Yes" if flag else "No")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
total = sum(a)
c = total / 2
dist = total
tmp = 0
p = 0
for i, bar in enumerate(a):
    tmp += bar
    if dist > abs(c - tmp):
        p = i
    if tmp >= c:
        break
l = sum(a[:p + 1])
r = sum(a[p + 1:])
ans = abs(l - r)
print(ans)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

# B - Crane and Turtle
x, y = map(int, input().split())

for crane in range(x + 1):
	turtle = x - crane
	
	if crane * 2 + turtle * 4 == y:
		print('YES')
		exit()

print('NO')
# Judge status: Accepted
a, b, c = map(int, input().split())
if a % 2 or b % 2 or c % 2:
   print(0)
   exit()
if a == b == c:
   print(-1)
   exit()

cnt = 0
while True:
   if a % 2 or b % 2 or c % 2:
      break
   cnt += 1
   next_a = b // 2 + c // 2
   next_b = a // 2 + c // 2
   next_c = a // 2 + b // 2
   a = next_a; b = next_b; c = next_c
print(cnt)
# Judge status: Accepted
p, q, r = map(int, input().split())

list = [p, q, r]
list.sort()

print(list[0] + list[1])
# Judge status: Accepted
a,b,c,d=map(int,input().split())
n=int(input())
if n == 1:
  print(min(a*4,b*2,c))
elif n%2 == 0:
  print(min(a*4*n,b*2*n,c*n,d*n//2))
else:
  print(min(a*4*n,b*2*n,c*n,n//2*d+min(a*4,b*2,c)))
# Judge status: Wrong Answer
n,a,b=map(int,input().split())
ans =0

if abs(a-b)%2:
    ans = min(b-1,n-a)
else:
    ans = abs(a-b)//2
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
if a % 2 == 0 or b % 2 == 0 or c % 2 == 0:
    ans = 0
else:
    ans = min(a * b, b * c, c * a)
print(ans)
# Judge status: Wrong Answer
def gcd(a, b):
    if a < b :
        a, b = b, a
    while True:
        a, b = b, a % b
        if b == 0:
            return a

a, b = map(int, input().split())
int(a * b / gcd(a, b))
# Judge status: Accepted
n = int(input())
g = [[0]*10 for _ in range(10)]
for i in range(1,1+n):
  a = int(str(i)[0])
  b = i%10
  g[a][b] += 1
ans = sum(g[a][b]*g[b][a] for a in range(10) for b in range(10))
print(ans)
# Judge status: Wrong Answer
N=int(input())
S=input()
stack= []
ans=""

for i in range(N):
  if S[i]=="(":
    stack.append(S[i])
  else:
    if len(stack)>0:
      ans = ans + stack.pop()+  ")"
    else:
      ans = "(" + ans + ")"

nokori=len(stack)
ans = nokori * "(" + ans + nokori * ")"

print(ans)