peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def main():
    a,b,c = map(int, input().split())
    if a == b != c or a != b == c or a == c != b:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())
 
face = (a+b)*h//2
print(face)
# Judge status: Accepted
x = input()

a,b,c ='Sunny', 'Cloudy', 'Rainy'

if x ==a:
    print(b)
elif x == b:
    print(c)
else:
    print(a)
# Judge status: Accepted
a = input().split(" ")
s = int(a[0])
w = int(a[1])

if w >= s:
  print("unsafe")
else:
  print("safe")
# Judge status: Accepted
l, r = map(int, input().split())
if r - l >= 2019:
    print(0)
else:
    l %= 2019
    r %= 2019
    if r < l:
        print(0)
    else:
        ans = 2019
        for i in range(l, r):
            for j in range(i + 1, r + 1):
                ans = min(ans, i * j % 2019)
        print(ans)
# Judge status: Wrong Answer
K=int(input())
if K%2==0:
  print(K*K//4)
else:
  print(K*(K//2+1)//2)
# Judge status: Wrong Answer
import math
N = int(input())

ans =0

for i in range(N):
  if math.floor(i*1.08) == N:
    print(i)
    ans += 1
    
if ans == 0:
  print(':(')
# Judge status: Accepted

A, B = map(int, input().split())
if A > 9 or B > 9:
    print(-1)
else:
    print(A * B)
# Judge status: Accepted
a, b, t = map(int, input().split())
time = t // a
print(time * b)
# Judge status: Wrong Answer
x, y = map(int, input().split())
a = abs(abs(x) - abs(y))
if x > -1 and y > -1:
    print(a)
elif x < 0 and y < 0:
    print(a + 2)
else:
    print(a + 1)
# Judge status: Accepted
A, B, C, K = map(int, input().split())
if K % 2 == 0:
    print(A-B)
else:
    print(B-A)
# Judge status: Accepted
N,K=map(int,input().split())
S=input()
S='.'+S
S=S+'.'
P=0
for i in range(N):
  if S[i+1]=='L':
    if S[i]=='L':
      P+=1
  else:
    if S[i+2]=='R':
      P+=1
print(min(N-1,P+K*2))
# Judge status: Accepted
import sys
import itertools

if __name__ == '__main__':
    N = int(sys.stdin.readline())
    L = list(map(lambda x: int(x), sys.stdin.readline().rstrip().split()))

    num = 0
    for items in itertools.combinations(L, 3):
        a, b, c = items
        if a == b or b == c or c == a:
            continue
        if a+b > c and b+c > a and c+a > b:
            num += 1
    print(num)
# Judge status: Accepted
n = int(input())

total = []


for i in range(1, n + 1):
    if i % 15 == 0:
        "FizzBuzz"
    elif i % 5 == 0:
        "Buzz"
    elif i % 3 == 0:
        "Fizz"
    else:
        total.append(i)  # リストに加える
print(sum(total))
# Judge status: Accepted
import math
k = int(input())

if k % 2 == 0:
  gusu, kisu = k / 2, k / 2
else:
  gusu, kisu = math.floor(k / 2), math.ceil(k / 2)

print(int(gusu*kisu))
# Judge status: Wrong Answer
s=input()
if s[-1]=='s':
    print(s[:-1]+'es')
else:
    print(s+'s')
# Judge status: Accepted
n = int(input())
W = list(map(int, input().split()))
sumW = sum(W)

ans = 10 ** 9
p = 0
for w in W:
  p += w
  ans = min(ans, abs(sumW - 2 * p))

print(ans)
# Judge status: Wrong Answer
s = input()
a = s.index('A')
print(s[a:].index('Z')+1)
# Judge status: Wrong Answer
a,b=(int(x) for x in input().split())
c = a + b
d = c - 24

if int(d) > 0:
    print( d )
else:
    print( c )
# Judge status: Wrong Answer
n = int(input())
s = input()
if n >= 3200:
  print("red")
else:
  print(s)
# Judge status: Wrong Answer
s = int(input())
import math
print(s*s*math.pi)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

X = [0]*N
Y = [0]*N

import fractions

X[0]=A[0]
for i in range(1,N):
    X[i] = fractions.gcd(X[i-1], A[i])

Y[N-1]=A[N-1]
for i in range(1,N):
    Y[N-1-i] = fractions.gcd(Y[N-i], A[N-1-i])

cand = []
cand.append(X[N-2])
cand.append(X[N-1])#=Y[0]
cand.append(Y[1])
for i in range(1,N-1):
    cand.append(fractions.gcd(X[i-1],Y[i+1]))

print(max(cand))
# Judge status: Accepted
N, M = map(int, input().split())
a, b = 1, N
S = set()
for _ in range(M):
    print(a, b)
    S.add(b - a)
    S.add(a + N - b)
    a += 1
    b -= 1
    if b - a in S or a + N - b in S or b - a << 1 == N:
        b -= 1
# Judge status: Accepted
N=input()
if(N[1:len(N)].count("9")!=len(N)-1):
    print(int(N[0])-1+9*(len(N)-1))
else:
    print(int(N[0])+9*(len(N)-1))
# Judge status: Accepted
import math
from decimal import Decimal

A, B = map(Decimal, input().split())
ANS = 0

ANS = math.floor(A * B)
print(ANS)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int , input().split()))
max_ = max(A)
A = list(set(A))
A_ = []
for i in A:
    A_.append(i-(int(max_-(i*int(max_/i)))))
A_ = list(set(A_))
A_ = sorted(A_)
print(A_[0])
# Judge status: Accepted
N=int(input())
A= list(map(int,input().split()))
list.sort(A,reverse=True)
a=0
b=0
for i in range(N):
    if(i%2==0):
        a+=A[i]
    else:
        b+=A[i]
print(a-b)
# Judge status: Accepted
n=int(input())
ct=0
p=list(map(int,input().split()))
mn=p[0]
for i in range(1,n):
    if mn>=p[i]:
        ct+=1
        mn=p[i]
print(ct+1)
# Judge status: Wrong Answer
N, A, B = int(input()), list(map(int, input().split())), list(map(int, input().split()))
result = 0
for i in range(N):
    a, a_next, b = A[i], A[i+1], B[i]
    if a >= b: result += b
    elif a + a_next < b:
        result += a + a_next
        a_next = 0
    else:
        a_next -= b - a
        result += b
print(result)
# Judge status: Wrong Answer
from collections import deque
N = int(input())
A = list(map(int,input().split()))
d = deque()
for i in range(N):
  if i%2==0:
    d.append(A[i])
  else:
    d.appendleft(A[i])
print(*d)
# Judge status: Wrong Answer
x, y = map(int, input().split())

if x > 0 and y > 0:
    if x < y:
        print(y-x)
    else:
        print(x-y+2)
elif x < 0 and y < 0:
    if x < y:
        print(y-x)
    else:
        print(x - y + 2)
else:
    print(abs(abs(y) - abs(x)) + 1)
# Judge status: Accepted
# -*- coding: utf-8 -*-
S = input()
red, blue = S.count('0'), S.count('1')
ret = 2 * min(red, blue)
print(ret)
# Judge status: Accepted
import sys
import math
def input(): return sys.stdin.readline().rstrip()
def main():
    h=int(input())
    print(2**(int(math.log2(h))+1)-1)

if __name__=='__main__':
    main()
# Judge status: Accepted
arr = input().split(' ')
a = list(arr[0])
b = list(arr[1])
c = list(arr[2])
print(a[0],b[0],c[0],sep = '')
# Judge status: Accepted
n=int(input())
s=input()
w_cnt=s.count(".")

ans=[w_cnt]
b=0
w=w_cnt

for i in range(n):
    if s[i]=="#":
        b+=1
    else:
        w-=1
    ans.append(b+w)

print(min(ans))
# Judge status: Wrong Answer
x=int(input())
count=0
k=-1
hap=list(map(int,input().split()))
count=max(hap)
k=hap.index(count)
for i in range(1,x):
    hap=list(map(int,input().split()))
    m=-1
    for j in range(len(hap)):
        if j!=k:
            if hap[j]>m:
                m=hap[j]
                ano=j
    count+=m
    k=ano
print(count)
# Judge status: Wrong Answer
L,R,d = map(int,input().split())

r = R//4
l = (L-1)//4

print(r-l)
# Judge status: Accepted
a = int(input()[-1])

if a in [2, 4, 5, 7, 9]:
    print("hon")
elif a in [0, 1, 6, 8]:
    print("pon")
else:
    print("bon")
# Judge status: Accepted
a, b = map(int, input().split())

if a <= 5:
  print(0)
elif a <= 12:
  print(b // 2)
else:
  print(b)
# Judge status: Accepted
N = int(input())
H = [int(x) for x in input().split()]

MAX = 0
Flag = True
for T in range(0,N):
    if H[T]>MAX:
        MAX = H[T]
    if MAX-H[T]>=2:
        Flag = False
        break
if Flag:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import numpy as np

c = []
for i in range(3):
    c.append(list(map(int, input().split())))

ans = []

c = np.array(c)
ch = np.diff(c)

if np.all(ch[0]==ch[1]) & np.all(ch[1]==ch[2]):
    ans.append(True)
else:
    ans.append(False)

cw = np.diff(c.T)

if np.all(cw[0]==cw[1]) & np.all(cw[1]==cw[2]):
    ans.append(True)
else:
    ans.append(False)

ans = "Yes" if all(ans) else "No"
print(ans)
# Judge status: Accepted
five = int(input()) + 1
hand = int(input()) + 1
fives = int(input()) + 1
ans = int(input()) 
tmp = 0
 
for i in range(five):
  for j in range(hand):
    for k in range(fives):
      ask = 500 * i + 100 * j + 50 * k
      if ans == ask:
        tmp = tmp + 1

print(tmp)
# Judge status: Accepted
a, b, c, d = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
while True:
    c = c - b
    if c <= 0:
        print("Yes")
        break
    a = a - d
    if a<=0:
        print("No")
        break
# Judge status: Accepted
def main():
    n = int(input())

    count = n + 1

    for i in range(1,int(n**0.5)+1):
        if n % i == 0 and n // i + i < count:
            count = n // i + i

    print(count-2)

if __name__ == '__main__':
    main()
# Judge status: Accepted
def main():
    n, c, k = map(int, input().split())
    t = [int(input()) for _ in range(n)]
    t.sort()
    ans = 0
    passengers = 0
    first = t[0]
    for tn in t:
        if tn > first + k or passengers == c:
            ans += 1
            passengers = 0
            first = tn
        passengers += 1

    print(ans + 1)


if __name__ == '__main__':
    main()
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
tot=sum(A)
cur=1
total=0
for d in range(N+1):
    if tot>=cur:
        total+=cur
    cur-=A[d]
    tot-=A[d]
    if cur<0:
        total=-1
        break
    cur=min(cur*2,tot)
print(total)
# Judge status: Accepted
n = int(input())
c = input()
l, r = 0, n-1
ans = 0
while l < r:
	if c[l] == "W" and c[r] == "R":
		ans += 1
		l, r = l+1, r-1
	else:
		if c[l] == "R":
			l += 1
		if c[r] == "W":
			r -= 1
print(ans)
# Judge status: Accepted
import math
n = int(input())
a = math.floor(n/1.08)
if a*1.08 >= n:
    print(a)
elif (a+1)*1.08 >= n and (a+1)*1.08 < n+1:
    print(a+1)
else:
    print(':(')
# Judge status: Accepted
n,k=map(int,input().split())
a=list(input())
count=0
for i in range(n):
    if a[i]=="L" and i-1>=0 and a[i-1]=="L":
        count+=1
    elif a[i]=="R" and i+1<=n-1 and a[i+1]=="R":
        count+=1
print(min(n-1,count+k*2))
# Judge status: Accepted
import sys
input = sys.stdin.readline

def fullsearch(x, k):
    for l, r in zip(x, x[k-1:]):
        distance = abs(r - l)
        yield distance + abs(r)
        yield distance + abs(l)

def main():
    _, K = map(int, input().split())
    X = list(map(int, input().split()))



    print(min(fullsearch(X, K)))

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

ans = 1
for i in range(K):
  if (S[i] != '1'):
    ans = S[i]
    break

print(ans)
# Judge status: Wrong Answer
base = input().split()
h = int(base[0])
a = int(base[1])
print((h//a)+1)
# Judge status: Wrong Answer
# 整数の入力
N = int(input())

print((10 ** (N-2) * N * (N-1) - (N * (N-1))) % (10**9 + 7))
# Judge status: Accepted
N=int(input())
A=[int(input()) for i in range(5)]
X=min(A)
ans=(N+X-1)//X +4
print(ans)
# Judge status: Accepted
S=input()

for i in range(len(S)):
  if i%2==0 and S[i]!="h":
    print("No")
    exit()
  elif i%2==1 and S[i]!="i":
    print("No")
    exit()

if len(S)%2==0:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

ch = 0
for i in a:
	if(i == 0):
		print(0)
		ch1 = 1
		break

if(not ch):
	ans = 1
	ch2 = 0
	for i in a:
		ans*=i
		if(ans > int(1e18)):
			print(-1)
			ch2 = 1
			break
	if(not ch2):
		print(ans)
# Judge status: Wrong Answer
d = dict(zip(input().split(), map(int, input().split())))
d[input()] -= 1
print(*d.values())
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
for i in range(n):
    a[i] = list(format(a[i],'0b').zfill(65))
g = [0 for i in range(65)]
for i in range(65):
    for j in range(n):
        if a[j][i] == '1':
            g[i] += 1
ans = 0
for i in range(len(g)):
    ans += g[i]*(n-g[i])*(2**(64-i))
    ans = ans%1024
print(int(ans))
# Judge status: Wrong Answer
n,m = map(int,input().split())
gate = [1,n]
for i in range(m):
    l,r = map(int,input().split())
    gate[0] = max(gate[0],l)
    gate[1] = min(gate[1],r)
print(gate[1]-gate[0]+1)
# Judge status: Accepted
X=int(input())
for A in range(120):
    for B in range(120):
        if A**5-B**5==X:
            print(A,B)
            exit()
        if A**5+B**5==X:
            print(A,B*(-1))
            exit()
# Judge status: Accepted
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n)]

ab_sorted = sorted(ab, key=lambda x:(x[0], -x[1]))

num = 0
amount_of_money = 0
for i in range(n):
  buy = min(ab_sorted[i][1], m-num)
  num += buy
  amount_of_money += ab_sorted[i][0] * buy
    
  if num >= m:
    print(amount_of_money)
    exit(0)
# Judge status: Accepted
n = int(input())
d = sorted(list(map(int, input().split())))

t = n//2
print(d[t]-d[t-1])
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [float('Inf')] * (10 ** 5 + 1)
dp[0] = 0
for i in range(n):
    for j in range(1, k + 1):
        if i + j < n:
            dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j] - h[i]))
print(dp[n - 1])
# Judge status: Accepted
k = int(input())
 
s = 7
for i in range(1, k+1):			# rangeの上限がk
    if s % k == 0:
        print(i)
        break
    s = (s * 10 + 7) % k		# %kが難しい
else:                           # for文にもelseが使える
    print(-1)
# Judge status: Accepted
w,h,N=map(int,input().split())
X,Y,W,H=0,0,w,h
for i in range(N):
    x,y,a=map(int,input().split())
    if a==1:X=max(x,X)
    elif a==2:W=min(W,x)
    elif a==3:Y=max(y,Y)
    else:H=min(y,H)
    if X>=w or Y>=h or W<=0 or H<=0 or X>=W or Y>=H:
        print(0)
        exit()
print((W-X)*(H-Y))
# Judge status: Accepted
n, m = map(int, input().split())
ans = 0
if m >= 2*n:
    ans += n + (m-2*n)//4
else:
    ans += m//2
print(ans)
# Judge status: Accepted
from decimal import *
import math
 
getcontext().prec = 50
 
a, b, c = map(int, input().split())
a = Decimal(a)
b = Decimal(b)
c = Decimal(c)
 
a = Decimal.sqrt(a)
b = Decimal.sqrt(b)
c = Decimal.sqrt(c)
 
if a + b < c:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
K = int(input())
X = 7
p = 0
for i in range(1, K+2):
  p = (p + X)%K
  if(p == 0):
    print(i)
    exit()
  X = (X*10)%K
print(-1)
# Judge status: Accepted
s = input()
a = 0
b = 0

if s[2] == '0': b = int(s[3])
else: b = int(s[2:])
if s[0] == '0': a = int(s[1])
else: a = int(s[:2])

if (b>=1 and b<=12) and (a>=1 and a<=12): print("AMBIGUOUS")
elif b>=1 and b<=12: print("YYMM")
elif a>=1 and a<=12: print("MMYY")
else: print("NA")
# Judge status: Accepted
a,b,x = (int(T) for T in input().split())
print((b//x)-(a//x)+(a%x==0))
# Judge status: Accepted
n = int(input())

for num in range(n, 1000):
    if num % 111 == 0:
        print(num)
        break
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))

longest =max(l)

index = l.index(longest)

total = 0
for i in range(n):
    if i!=index:
        total+=l[i]

if longest<total:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n,x=map(int,input().split())
l=list(map(int,input().split()))
d=[0]
for i in range(n):
  d.append(d[i]+l[i])
  if d[i+1]>x:
    break

print(len(d)-1)
# Judge status: Accepted
from collections import Counter as C

n  =  int(input())
a= list(input().split())
al = list([int(i) for i in a])
aset = set([int(i) for i in a])

cnt=0
ca = C(al)
#print(C(al)[0])
for i in aset:
  #print(i)
  #print(al.count(i-1),al.count(i),al.count(i+1))
  if cnt < ca[i-1] + ca[i] + ca[i+1]:
    cnt = ca[i-1] + ca[i] + ca[i+1]

print(cnt)
# Judge status: Wrong Answer
a,b,x=map(int,input().split())
d=b-a
ans=d//x
if a%x==0 or b%x==0:
    ans+=1
if a==b:
    ans=0
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

hako=[0]*n
for i in range(n):
    # print(n-i-1, sum(hako[n-i-1:n:n-i]))
    if (sum(hako[n-i-1:n:n-i])%2)!=a[n-i-1]:
        hako[n-i-1]+=1
# print(hako)

ans=[]
for i in range(n):
    if hako[i]==1:
        ans.append(str(i+1))

print(len(ans))
if len(ans)!=0:
    print(' '.join(ans))
# Judge status: Accepted
n = int(input())

dp = [10**6 for _ in range(10**6)]
dp[0] = 0

for i in range(1,n+1):
    j6 = 1
    while 0 <= i-j6:
        dp[i] = min(dp[i-j6]+1,dp[i])
        j6 *= 6
    j9 = 1
    while 0 <= i-j9:
        dp[i] = min(dp[i-j9]+1,dp[i])
        j9 *= 9
print(dp[n])
# Judge status: Wrong Answer
N,M,X = map(int, input().split())
A = [list(map(int, input().split(" "))) for i in range(N)]

MOD = 10**9+7
a = [0]*M
value = MOD
ans = MOD

for i in range(2**N):
    if min(a) >= X :
        ans = min(ans,value)
    a = [0]*M
    value = 0

    for j in range(M+1):
        if(i >> j) & 1:
            for k in range(M):
                a[k] += A[j][k+1]
            value += A[j][0]

print(-1 if ans == MOD else ans)
# Judge status: Wrong Answer
N,K = map(int,input().split())
candle = list(map(int,input().split()))

min_value = 10*6

for i in range(N-K+1):
    left = abs(candle[i])+abs(candle[i]-candle[i+K-1])
    right = abs(candle[i+K-1])+abs(candle[i]-candle[i+K-1])
    if min_value > min(left,right):
        min_value = min(left,right)
        
        
print(min_value)
# Judge status: Accepted
N = int(input())
if (N%10 == 2) or (N%10 == 4) or (N%10 == 5) or (N%10 == 7) or (N%10 == 9):
    print("hon")
elif (N%10 == 0) or (N%10 == 1) or (N%10 == 6) or (N%10 == 8):
    print("pon")
else:
    print("bon")
# Judge status: Accepted
#!/usr/bin/env python3
import re
s = input()
print(re.sub(r'[a-z]','x',s))
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
a_n = []

for i in range(n):
    a_n.append(a[i])
    a_n.append(a[i]-1)
    a_n.append(a[i]+1)


counter=Counter(a_n)

print(a_n.count(counter.most_common()[0][0]))
# Judge status: Accepted
N = int(input())

S = []
cnt = 0
for n in range(N):
  temp = input()
  S.append(temp)

S = set(S)
print(len(S))
# Judge status: Wrong Answer
import fractions
N, M = map(int, input().split())
AA = list(map(int, input().split()))
A = list(map(lambda x:x//2, AA))

ans = A[0]
for i in range(1, N):
    ans = ans * A[i] // fractions.gcd(ans, A[i])

ans = (M//ans - 1)//2 + 1 if ans > 0 else 0
print(ans)
# 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():
    a, b = geta(int)

    if b == 1:
        print(0)
        exit()

    n = 1
    while a * n - n + 1 < b:
        n += 1

    print(n)


if __name__ == "__main__":
    main()
# Judge status: Accepted
from operator import itemgetter
N = int(input())
ls = sorted(sorted([list(map(int,input().split())) for _ in range(N)]),key=itemgetter(1))



flag = 1
t = 0
for i in range(N):
  t += ls[i][0]
  if ls[i][1] < t:
    flag = 0
    print("No")
    break

if flag == 1:
  print("Yes")
# Judge status: Accepted
N=int(input())

i=1
Sum=0
while Sum<N:
    Sum+=i
    i+=1

ans=[]
Top=i-1
while N:
    if N-Top>=0:
        N-=Top
        ans.append(Top)
    Top-=1

for j in ans:
    print(j)
# Judge status: Accepted
x,y,z=[int(x) for x in input().split()]
x-=z
print(x//(y+z))
# Judge status: Accepted
n = int(input())
N = input()
L = 0
R = 0
num = 0
for c in N:
    if c == '(':
        num += 1
    else:
        if num:
            num -= 1
        else:
            L += 1
R = num
 
print('('*L+N+')'*R)
# Judge status: Accepted
n,m = map(int,input().split())
cnt = 0
if m // 2 >= n:
    cnt += n
    m -= n*2
else:
    cnt += m//2
    n -= m//2
    m -= m

#print(n,m)
cnt += m//4

print(cnt)
# Judge status: Accepted
S = input()
lis = [S[0]]
i = 1
while i<len(S)-1:
  if S[i]==lis[-1]:
    lis.append(S[i:i+2])
    i += 2
  else:
    lis.append(S[i])
    i += 1
ans = len(lis)
if i==len(S)-1 and S[i]!=lis[-1]:
  ans += 1
print(ans)
# Judge status: Wrong Answer
alphabet = [chr(i) for i in range(97, 97+26)]
n = int(input())
keta = 0
while True:
    if n <= 26 ** keta:
        break
    keta += 1
ans = ''
for i in range(keta-1,-1,-1):
    num = 1
    while (num+1) * 26**(i) <= n:
        num+= 1
    # この時点でnumは、26**iをいくつまで含むことができるか？という数
    ans += alphabet[num-1]
    n -= num * 26**i

print(ans)
# Judge status: Wrong Answer
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

bool = False
for i in range(x[-1]+1, y[0]+1):
    if X < i <= Y:
        bool = True
        break
        
print('No War' if bool else 'War')
# Judge status: Accepted
N=int(input())
p=list(map(int,input().split()))
count=0
f=0
for i in range(N):
    if f:
        f=0
        continue
    if p[i]==i+1:
        count+=1
        f=1
print(count)
# Judge status: Accepted
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A, B = map(int, readline().split())
S = readline().decode('utf8').rstrip()
T=S[:A]+S[A+1:]
bl = S[A] == '-' and not('-' in T)

print('Yes' if bl else 'No')
# Judge status: Accepted
t = input()

if "a" == t:
    print("vowel")
elif "i" == t:
    print("vowel")
elif "u" == t:
    print("vowel")
elif "e" == t:
    print("vowel")
elif "o" == t:
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
x,a,b = map(int,input().split())

if abs(x-a) <= abs(x-b):
  print("A")
else:
  print("B")
# Judge status: Wrong Answer
s = input()
for i in range(len(s)):
    if s[i] == 'A':
        start = i
        break
for i in range(1,len(s)):
    if s[-i] == 'Z':
        end = i
        break
print(len(s[start:-end+1]))
# Judge status: Wrong Answer
N = int(input())

for i in range(11):
    if N < 1000:
        break
    N = N - 1000
     
print(N)
# Judge status: Accepted
a,b = map(int,input().split())

if a>b:
	print('safe')
else:
		print('unsafe')
# Judge status: Wrong Answer
walklist=[]
a,b,c,d=map(int,input().split())
x_diff=c-a
y_diff=d-b
walklist.append("U"*y_diff)
walklist.append("R"*x_diff)
walklist.append("D"*y_diff)
walklist.append("L"*(x_diff+1))
walklist.append("U"*(y_diff+1))
walklist.append("R"*(x_diff+2))
walklist.append("D"*(y_diff+2))
walklist.append("L"*(x_diff+1))
walklist.append("U")
print("".join(walklist))
# Judge status: Wrong Answer
N = int(input())
S = input()

ans = 0
x = 0
for s in S:
  v = 1 if s == 'I' else 0
  x += v
  ans = max(ans, x)
print(ans)
# Judge status: Wrong Answer

n = int(input())

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

for i in range(len(a)):
    sum += b[a[i] - 1]
    print("i:{0} sum{1}".format(i, sum))
    if(i != len(a) - 1 and a[i] + 1 == a[i + 1]):
        sum += c[a[i] - 1]
        #print("i:{0} sum{1}".format(i, sum))#

print(sum)
# Judge status: Accepted
a, b, c = map(int, input().split())
if a+b < c:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
num = list(map(int, input().split()))

ans = sorted(num)
if(ans[0]==5 and ans[1]==5 and ans[2] == 7):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
k=int(input())
ans=1
judge=0
s=7%k
while ans<=k:
    if s==0:
        judge=1
        break
    else:
        s=s*10+7
        s%=k
        ans+=1
if judge==1:
    print(ans)
else:
    print(-1)
# Judge status: Accepted
import numpy as np
from functools import reduce


mod = 10**9+7
def cmb(R,B):
    numerator = reduce(lambda x,y: x * y % mod, [R+B-k for k in range(B)])
    denominator = reduce(lambda x, y: x * y % mod, [B-k for k in range(B)])
    return numerator * pow(denominator, mod - 2, mod) % mod


S = int(input())
p = S // 3
A = 0

for b in range(p):

    r = S-3*(b+1)

    if b == 0:
        A+=1
    else:
        A+=cmb(r,b)

print(A%mod)
# Judge status: Accepted
abc=list(map(int,input().split()))
abc.sort(reverse=True)
print(abc[0]*10+abc[1]+abc[2])
# Judge status: Accepted
import collections

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

cnt = 0
for k,v in c.items():
  cnt += min(v-k,v) if v-k >=0 else v
print(cnt)
# Judge status: Wrong Answer
n, k = map(int, input().split())

okashi = set(list(range(1, n)))

for i in range(k):
    d = int(input())
    A = set(map(int, input().split()))
    okashi = okashi - A 
print(len(okashi))