Harryxun/stf_run huggingface dataset:
n, m, x, y = [int(i) for i in input().split(" ")]
x_range = [int(i) for i in input().split(" ")]
y_range = [int(i) for i in input().split(" ")]
war = True
for z in range(x, y):
    if x < z <= y and max(x_range) < z <= min(y_range[:m]):
        war = False
print("War" if war else "No War")


### FIXED CODE ###

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

ans = 0
for k1, v1 in enumerate(input_data):
    for k2, v2 in enumerate(input_data):
        for k3, v3 in enumerate(input_data):
            if k1 == k2 or k2 == k3 or k3 == k1:
                continue
            kou1 = int(str(v1) + str(v2))
            kou2 = v3
            if ans < kou1 + kou2:
                ans = kou1 + v3
print(ans)
def find_index_by_value(a, val):
    for i, items in enumerate(a):
        if val in items:
            return i
    return -1


def num_reachable(n):
    return n * (n - 1) // 2


n, m = map(int, input().split())
edges = []

for _ in range(m):
    a, b = map(int, input().split())
    edges.append((a, b))

size = [1 for _ in range(n + 1)]
group = [i for i in range(n + 1)]

find_group = lambda x: x if x == group[x] else find_group(group[x])

ans = []
not_reachable = n * (n - 1) // 2
reachable_node = []
ans.append(not_reachable)

count = not_reachable
reachable = 0
for _ in range(m - 1):
    a, b = edges.pop()
    if count > 0:
        ra = find_group(a)
        rb = find_group(b)
        if rb != ra:
            s_ra = size[ra]
            s_rb = size[rb]
            new_size = s_ra + s_rb
            size[ra] = new_size
            group[rb] = ra
            reachable += num_reachable(new_size) - num_reachable(s_ra) - num_reachable(s_rb)
        count = not_reachable - reachable
    ans.append(count)

for _ in range(len(ans)):
    print(ans.pop())




### FIXED CODE ###

def find_index_by_value(a, val):
    for i, items in enumerate(a):
        if val in items:
            return i
    return -1


def num_reachable(n):
    return n * (n - 1) // 2


n, m = map(int, input().split())
edges = []

for _ in range(m):
    a, b = map(int, input().split())
    edges.append((a, b))

size = [1 for _ in range(n + 1)]
group = [i for i in range(n + 1)]


def find_group(x):
    c = []
    p = x
    while True:
        pp = group[p]
        if pp == p:
            break
        else:
            c.append(p)
            p = pp
    for i in c:
        group[i] = pp
    return pp

# find_group = lambda x: x if x == group[x] else find_group(group[x])

ans = []
not_reachable = n * (n - 1) // 2
reachable_node = []
ans.append(not_reachable)

count = not_reachable
reachable = 0
for _ in range(m - 1):
    a, b = edges.pop()
    if count > 0:
        ra = find_group(a)
        rb = find_group(b)
        if rb != ra:
            s_ra = size[ra]
            s_rb = size[rb]
            new_size = s_ra + s_rb
            reachable += num_reachable(new_size) - num_reachable(s_ra) - num_reachable(s_rb)
            size[ra] = new_size
            group[rb] = ra
        count = not_reachable - reachable
    ans.append(count)

for _ in range(len(ans)):
    print(ans.pop())
import numpy as np
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
A_array = np.array(A)
B_array = np.array(B)
A_cum = np.cumsum(A_array)
B_cum = np.cumsum(B_array)
for i in range(len(A_cum)):
    k = A_cum[i]
    if k >K:
        break
    a = 0
    b = len(B_cum)-1
    print(B_check)
    while b - a != 0:
        c = int(round((a+b)/2))
        if B_check[c] < 0:
            b = c
        else:
            a = c
        if b-a == 1:
            if B_check[b] < 0:
                b = a
            else:
                a = b
    check = i+b+2
    if check>ans:
        ans = check
print(ans)

### FIXED CODE ###

import bisect
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
A_cum = [0]
B_cum = [0]
A_cum[0] = A[0]
for j in range(len(A)-1):
    A_cum.append(A_cum[j]+ A[j+1])
B_cum[0] = B[0]
for l in range(len(B)-1):
    B_cum.append(B_cum[l] + B[l+1])
for i in range(len(A_cum)):
    k = A_cum[i]
    if k >K:
        break
    b = bisect.bisect(B_cum,K-k)
    check = i+b+1
    if check>ans:
        ans = check
check = bisect.bisect(B_cum,K)
if check>ans:
    ans = check    
print(ans)
import sys

sys.setrecursionlimit(1000000000000000)


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

if a >= k:
    a = a - k
    print("{} {}".format(a, b))
elif k > a and a + b >= k:
    b = a + b - k
    print("{} {}".format(0, b))
else:
    print("{} {}".format(0, 0))



### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000000)


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

if a >= k:
    a = a - k
    print("{} {}".format(a, b))
elif k > a and a + b >= k:
    b = a + b - k
    print("{} {}".format(0, b))
else:
    print("{} {}".format(0, 0))
11 10 9

### FIXED CODE ###

def fn(x):
    return ((a*x)//b) - a*(x//b)
a,b,n = map(int, input().split())
ans = 0
if b <= n:
    ans = b-1
else:
    ans = n
print(fn(ans))
s = input()
t = input()

ans = 10000
for i in range(len(s) - len(t) + 1):
  tmp = 0
  for i in range(len(t)):
    if s[i + j] != s[j]:
      tmp+=1
    ans = min(ans, tmp)
print(ans)

### FIXED CODE ###

s = input()
t = input()
 
ans = 10000
for i in range(len(s) - len(t) + 1):
  tmp = 0
  for j in range(len(t)):
    if s[i + j] != t[j]:
      tmp+=1
  ans = min(ans, tmp)
print(ans)
while True:
   ip = input()
   ip = ip.strip().split()
   a,b = int(ip[0]),int(ip[1])
   if a > b:
      print("a > b")
   elif a < b:
      print("a < b")
   else:
      print("a == b")

### FIXED CODE ###

ip = input()
ip = ip.strip().split()
a,b = int(ip[0]),int(ip[1])
if a > b:
   print("a > b")
elif a < b:
   print("a < b")
else:
   print("a == b")
# D
n = int(input())
a = list(map(int, input().split()))

l_minus = [i for i in a if i <= 0]
l_plus = [i for i in a if i > 0]
ans = 0
if len(l_minus) % 2 == 0:
    l_minus_edit = [-i for i in l_minus]
else:
    l_minus_edit = [-i for i in l_minus]
    plus = l_plus.extend(l_minus_edit)
    l_minus_edit.append(-min(plus) * 2)
    
ans = sum(l_plus) + sum(l_minus_edit)
print(ans)

### FIXED CODE ###

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

l_minus = [i for i in a if i <= 0]
l_plus = [i for i in a if i > 0]

ans = 0
if len(l_minus) % 2 == 0:
    l_minus_edit = [-i for i in l_minus]
else:
    l_minus_edit = [-i for i in l_minus]
    temp = l_plus[:]
    temp.extend(l_minus_edit)
    l_minus_edit.append(-min(temp) * 2)

ans = sum(l_plus) + sum(l_minus_edit)
print(ans)
def Judgement(x,y,z):
    if z-x-y>0 and (z-x-y)**2-4*x*y>0:
        return 0
    else:
        return 1

a,b,c=map(int,input().split())
ans=Judgement(a,b,c)
if ans=0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import math
a,b,c = map(int, input().split())
x=a**2+b**2+c**2+2*a*b-2*b*c-2*a*c
y=4*a*b

if c-b-a>0 and x-y>0 :
    print("Yes")
else:
    print("No")
a = input()
b = input()
c = input()

len_a = len(a)
len_b = len(b)
len_c = len(c)

def match(a, b):
    return a=='?' or b=='?' or a==b


ab = [True] * 9000
ac = [True] * 9000
bc = [True] * 9000

def check(a, b, ab):
    for i in range(len(a)):
        for j in range(len(b)):
            if not match(a[i], b[j]):
                ab[i-j+4500] = False

check(a, b, ab)
check(a, c, ac)
check(b, c, bc)

len_max = len(a)+len(b)+len(c)

ans = len_max
for i in range(-2*len_max, 2*len_max+1):
    for j in range(-2*len_max, 2*len_max+1):
        if ab[i+4500] and ac[j+4500] and bc[j-i+4500]:
            ans = min(ans, max(len_a, len_b+i, len_c+j) - min(0, i, j))
print(ans)



### FIXED CODE ###

"""
a = 'a'*2000
b = 'b'*2000
c = 'c'*2000
"""
a = input()
b = input()
c = input()


len_a = len(a)
len_b = len(b)
len_c = len(c)

def match(a, b):
    return a=='?' or b=='?' or a==b

dp_len=50000
ab = [True] * dp_len
ac = [True] * dp_len
bc = [True] * dp_len

def check(a, b, ab):
    for i in range(len(a)):
        for j in range(len(b)):
            if not match(a[i], b[j]):
                ab[i-j+dp_len//2] = False

check(a, b, ab)
check(a, c, ac)
check(b, c, bc)

len_max = 2000

ans = len_a+len_b+len_c
for i in range(-2*len_max, 2*len_max+1):
    for j in range(-2*len_max, 2*len_max+1):
        if ab[i+dp_len//2] and ac[j+dp_len//2] and bc[j-i+dp_len//2]:
            ans = min(ans, max(len_a, len_b+i, len_c+j) - min(0, i, j))
print(ans)
def lcm(a, b):
    from math import gcd

    return a // gcd(a, b) * b


def main():
    _ = int(input())
    a = list(map(int, input().split()))
    x = 1

    for e in a:
        x = lcm(x, e)

    ans = 0
    for e in a:
        ans += x // e

    print(ans % int(1e9 + 7))


main()


### FIXED CODE ###

def lcm(a, b):
    from fractions import gcd

    return a // gcd(a, b) * b


def main():
    _ = int(input())
    a = list(map(int, input().split()))
    x = 1

    for e in a:
        x = lcm(x, e)

    ans = 0
    for e in a:
        ans += x // e

    print(ans % int(1e9 + 7))


main()
import sys
sys.setrecursionlimit(10**9)
s = input()
t = input()
ls = len(s)
lt = len(t)
S = s*(lt//ls+2)
N = len(S)
mod = 2**61-1
base = 4#ランダムに撮るのが好ましい
power = [1]*N#power[i] = base^iの配列
for i in range(1, N):
    power[i] = power[i-1]*base%mod
rolling_hash = [0]*(N+1)
k = lt
for i, s in enumerate(S[:k]):
    rolling_hash[i+1] = rolling_hash[i]*base+ord(s)
for i in range(k, N):
    rolling_hash[i+1] = ((rolling_hash[i]-ord(S[i-k])*power[k-1])*base+ord(S[i]))%mod
thash = sum(ord(t[i])*power[lt-i-1] for i in range(lt))
is_same = [False]*ls
for i, h in enumerate(rolling_hash[k:ls+k]):
    if h == thash:
        is_same[i] = True
length = [-1]*N
is_visited = [False]*N
def rec(i):
    if length[i]>=0:
        return length[i]
    if is_visited[i]:
        return -1
    is_visited[i] = True
    if not is_same[i]:
        length[i] = 0
        return 0
    ni = (i+lt)%ls
    length[i] = rec(ni)+1
    if length[i] == 0:
        return -1
    return length[i]
for i in range(ls):
    if is_visited[i]:
        continue
    res = rec(i)
    if res == -1:
        ans = -1
        break
    ans = max(ans, res)
print(ans)


### FIXED CODE ###


def search_rolling_hash(S, T):
    base = 1234
    mod = 10**9+7
    n, m = len(S), len(T)
    rolling_hash = [0]*(n-m+1)  
    rolling_hash[0] = ord(S[0])
    b_m = pow(base, m, mod)
    T_hash = ord(T[0])
    start_index = []
    for i in range(1, m):
        rolling_hash[0]*=base
        rolling_hash[0]+=ord(S[i])
        rolling_hash[0]%=mod
        T_hash = (T_hash*base+ord(T[i]))%mod
    if rolling_hash[0] == T_hash: start_index.append(0)
    for i in range(1, ls):
        rolling_hash[i] = (rolling_hash[i-1]*base-ord(S[i-1])*b_m+ord(S[i+m-1]))%mod
        if rolling_hash[i] == T_hash: start_index.append(i)
    return start_index
import sys
s = input()
t = input()
ls, lt = len(s), len(t)
S = s*(lt//ls+2)
index = search_rolling_hash(S, t)
flag = [False]*ls
for i in index:
    flag[i] = True
stack = []
inf = float('inf')
cnt = [inf]*ls
for i in range(ls):
    if flag[i] == False:
        stack.append(i)
        cnt[i] = 0
while stack:
    x = stack.pop()
    y = (x-lt)%ls
    if cnt[y] == inf:
        cnt[y] = cnt[x]+1
        stack.append(y)
ans = max(cnt)
if ans == inf:
    print(-1)
else:
    print(ans)
n=int(input())
a=2
b=1
if n==1:
    print(1)
else:
    for i in range(2,n+1):
        c=a+b
        a,b=b,c
print(c)

### FIXED CODE ###

n=int(input())
a=2
b=1
if n==1:
    print(1)
    exit()
else:
    for i in range(2,n+1):
        c=a+b
        a,b=b,c
print(c)
import sys
sys.setrecursionlimit(2000000000)

p = 10 ** 9 + 7
N = 10 ** 6  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
  fact.append((fact[-1] * i) % p)
  inv.append((-inv[p % i] * (p // i)) % p)
  factinv.append((factinv[-1] * inv[-1]) % p)

def comb(n, r, p):
  if (r < 0) or (n < r):
    return 0
  r = min(r, n - r)
  return fact[n] * factinv[r] * factinv[n-r] % p



a1,b1,a2,b2=map(int,input().split())
score=comb(a2+b2+2,a2+1,p)-comb(a2+b1+1,a2+1,p)-comb(a1+b2+1,a1,p)+comb(a1+b1,a1,p)
print(score%(10**9+7))

### FIXED CODE ###

a1,b1,a2,b2=map(int,input().split())

import sys
sys.setrecursionlimit(2000000000)

p = 10 ** 9 + 7
N = a2+b2+2  # N は必要分だけ用意する
R = max(a2+1,b2+1)
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
  fact.append((fact[-1] * i) % p)
  
for i in range(2, R + 1):
  inv.append((-inv[p % i] * (p // i)) % p)
  factinv.append((factinv[-1] * inv[-1]) % p)

def comb(n, r, p):
  if (r < 0) or (n < r):
    return 0
  r = min(r, n - r)
  return fact[n] * factinv[r] * factinv[n-r] % p

score=comb(a2+b2+2,a2+1,p)-comb(a2+b1+1,a2+1,p)-comb(a1+b2+1,a1,p)+comb(a1+b1,a1,p)
print(score%(10**9+7))
n,m,c = map(int,input().split())
b = map(int,input().split())
cnt = 0
sum = 0
for i in range(n):
  a = map(int,input().split())
  for j in range(m):
    sum += (a[j]*b[j])
  sum += c
  if sum > 0:
    cnt += 1
  else:
    pass
print(cnt)

### FIXED CODE ###

n,m,c = map(int,input().split())
b = list(map(int,input().split()))
cnt = 0
for i in range(n):
  a = list(map(int,input().split()))
  sum = 0
  for j in range(m):
    sum += (a[j]*b[j])
  sum += c
  if sum > 0:
    cnt += 1
  else:
    pass
print(cnt)
import math

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


def combinations_count(N, R):
    return math.factorial(N) // (math.factorial(N - R) * math.factorial(R))


for i in range(1, k + 1):
    answer = combinations_count(k - 1, i - 1) * combinations_count(n - k + 1, i)
    # print(combinations_count(i - 1 + k, i - 1), combinations_count(n - k + 1, i))
    print(answer % (10 ** 9 + 7))

### FIXED CODE ###

import math

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


def combinations_count(N, R):
    return math.factorial(N) // (math.factorial(N - R) * math.factorial(R))


for i in range(1, k + 1):
    # 注意！もし青玉の置く場所がiより少なかったら置くことができないので、0通り
    if n - k + 1 < i:
        print(0)
    else:
        answer = combinations_count(k - 1, i - 1) * combinations_count(n - k + 1, i)
        # print(combinations_count(i - 1 + k, i - 1), combinations_count(n - k + 1, i))
        print(answer % (10 ** 9 + 7))
import sys
def input(): return sys.stdin.readline().strip()

def main():
    n, x, m = map(int, input().split())
    if x == 0:
        print(0)
        return
    if x == 1:
        print(n)
        return

    d = {}
    d_idx = {}
    d_unit = {}
    idx = 0
    pow_x = x
    unit = 0
    while idx < n and pow_x not in d:
        d[pow_x] = idx
        d_idx[idx] = pow_x
        unit += pow_x
        d_unit[idx] = unit

        pow_x *= pow_x
        pow_x %= m
        idx += 1
    # x^{2^idx} = 1

    if idx == n - 1:
        print(unit)
        return
    pre_idx = d[pow_x]
    pre_unit = d_unit[pre_idx] - d_idx[pre_idx]
    iter_unit = unit - pre_unit
    ans = pre_unit + iter_unit * ((n - pre_idx) // (idx - pre_idx))
    for i in range((n - pre_idx) % (idx - pre_idx)):
        ans += d_idx[i + pre_idx]
    print(ans)

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()

def main():
    n, x, m = map(int, input().split())
    if x == 0:
        print(0)
        return
    if x == 1:
        print(n)
        return

    d = {}
    d_idx = {}
    d_unit = {}
    idx = 0
    pow_x = x
    unit = 0
    while idx < n and pow_x not in d:
        d[pow_x] = idx
        d_idx[idx] = pow_x
        unit += pow_x
        d_unit[idx] = unit

        pow_x *= pow_x
        pow_x %= m
        idx += 1
    # x^{2^idx} = 1

    if idx == n:
        print(unit)
        return
    pre_idx = d[pow_x]
    pre_unit = d_unit[pre_idx] - d_idx[pre_idx]
    iter_unit = unit - pre_unit
    ans = pre_unit + iter_unit * ((n - pre_idx) // (idx - pre_idx))
    for i in range((n - pre_idx) % (idx - pre_idx)):
        ans += d_idx[i + pre_idx]
    print(ans)

if __name__ == "__main__":
    main()
x,y=map(int,input().split())
ans=0
if x==1 and y==1:
    ans+=400000
if x==3:
    ans+=100000
if x==2:
    ans+=200000
if x==1:
    ans+=300000
if y==3:
    ans+=100000
if y==2:
    ans+=200000
if y==1:
    ans+=300000
print(ans)
~


### FIXED CODE ###

x,y=map(int,input().split())
ans=0
if x==1 and y==1:
    ans+=400000
if x==3:
    ans+=100000
if x==2:
    ans+=200000
if x==1:
    ans+=300000
if y==3:
    ans+=100000
if y==2:
    ans+=200000
if y==1:
    ans+=300000
print(ans)
N=int(input())
alist=[0]+list(map(int,input().split()))

answer=0
if alist[N]=N:
  alist[N-1],alist[N]=alist[N],alist[N-1]
  answer+=1

for i in range(1,N+1):
  if alist[i]==i:
    alist[i],alist[i+1]=alist[i+1],alist[i]
    answer+=1
    
print(answer)

### FIXED CODE ###

N=int(input())
alist=[0]+list(map(int,input().split()))

answer=0
if alist[N]==N:
  alist[N-1],alist[N]=alist[N],alist[N-1]
  answer+=1

for i in range(1,N+1):
  if alist[i]==i:
    alist[i],alist[i+1]=alist[i+1],alist[i]
    answer+=1
    
print(answer)
k,n=int(input().split())
a = list(map(int,input().split()))
m = k-a[n-1]+a[0]
 
for i in range(n-1):
	m = max(m,a[i+1]-m[n])

x = k-m
print(x)

### FIXED CODE ###

k,n=map(int,input().split())
a = list(map(int,input().split()))
m = k-a[n-1]+a[0]
for i in range(n-1):
	m = max(m,a[i+1]-a[i])
x = k-m
print(x)
N, Y = map(int, input().split())
for x in range(N+1):
    for y in range(N-x+1):
        z = N-x-y
        if 10000*x+5000*y+1000*z == Y:
            print(x, y, z)
            exit()
print(-1, -1, -1)

### FIXED CODE ###

S = list(input())
S[3] = "8"
print("".join(S))
# -*- encoding: utf-8 -*-

if __name__ == '__main__':
    x = input()
    a = x.split(' ')[0]
    b = x.split(' ')[1]

    if a > b:
        print('a > b')
    elif a < b:
        print('a < b')
    else:
        print('a == b')


### FIXED CODE ###

line = int(input())

h = int(line / 3600)

m = int(line % 3600 / 60)

s = int(line % 3600 % 60)

print(str(h) + ':' + str(m) + ':' + str(s))
import math

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

B = [[0] * 2 for _ in range(40)]

for i in range(N):
  Ai = A[i]
  for j in range(40):
    if Ai % 2 == 0:
      B[j][0] += 1
    else :
      B[j][1] += 1
    Ai = Ai // 2
    #print(B)

Xmax = 0
if K != 0:

  Kd = int(math.log2(K))+1

  for i in range(Kd-1,-1,-1):
    if B[i][0] > B[i][1]:
      Xmax += 2**i
      if Xmax > K:
        Xmax -= 2**i
    
ans = 0
for i in range(N):
  ans += Xmax ^ A[i]

print(ans)

### FIXED CODE ###

import math

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

B = [[0] * 2 for _ in range(40)]

for i in range(N):
  Ai = A[i]
  for j in range(40):
    if Ai % 2 == 0:
      B[j][0] += 1
    else :
      B[j][1] += 1
    Ai = Ai // 2
    #print(B)

Xmax = 0
if K != 0:

  Kd = int(math.log2(K))+1

  for i in range(Kd-1,-1,-1):
    if B[i][0] > B[i][1]:
      Xmax += 2**i
      if Xmax > K:
        Xmax -= 2**i
    
ans = 0
for i in range(N):
  ans += Xmax ^ A[i]

print(ans)
import numpy as np
n = int(input())
a_list = np.array(list(map(int, input().split())))

counter = 0
while True:
    if np.sum(a_list % 2) > 0:
        break
    counter += 1
    a_list = a_list / 2
print(counter)


### FIXED CODE ###

s = input()
counter = 0

for i in range(len(s)):
    if s[i] == '1':
        counter += 1
print(counter)
n = int(input())
print(10**n=9**n-8**n-9**n)

### FIXED CODE ###

n = int(input())
if n == 1:
  print(0)
  exit()

print((10**n-9**n+8**n-9**n)%(10**9+7))
# class Map(dict):
#     def __missing__(self, key):
#         # この割当てなしのほうが速い。
#         # self[key] = 0
#         return 0


def main():
    int(input())

    d = {}
    ans = 0
    for i, height in enumerate(input().split()):
        height = int(height)
        # 引き算のほうの i は足し算のよりも大きい。
        # 従って，このように順番に見ていく必要がある。
        got = d.get(i + height) or 0
        d[i + height] += got + 1
        ans += d.get(i - height) or 0

    return ans


if __name__ == '__main__':
    print(main())

# 大いに参考にした。
# https://kmjp.hatenablog.jp/entry/2020/05/03/1030


### FIXED CODE ###

class Map(dict):
    def __missing__(self, key):
        default_value = 0
        self[key] = default_value
        return default_value


def main():
    int(input())

    d = Map()
    ans = 0
    for i, height in enumerate(input().split()):
        height = int(height)
        d[i + height] += 1
        ans += d[i - height]

    return ans


if __name__ == '__main__':
    print(main())
import sys
input = sys.stdin.readline

s = [import()] 

if  a[0] == a[1] == a[2]:
	print("Yes")
else:
	print("No")

### FIXED CODE ###

import sys
input = sys.stdin.readline
s = input()

if  s[0] == s[1] == s[2]:
    print("No")
else:
    print("Yes")
while True:
    n=input()
    if n==0:break
    D={}
    m=0
    for i in range(n):
        p,d1,d2=map(int,raw_input().split())
        t=d1+d2
        m=max(m,t)
        D[t]=p
    print D[m],m

### FIXED CODE ###

while True:
    try:
        n=input()
        if n==0:break
        m=0
        dic={}
        for i in range(n):
            p,d1,d2=map(int,raw_input().split())
            t=d1+d2
            m=max(m,t)
            dic[t]=p
        print dic[m],m
    except SyntaxError:
        pass
inputs = input().split()
N = int(inputs[0])
A = list(map(int, input[1:]))

sum = 0

for i in range(1, N):
  if A[i] < A[i-1]:
    sum += A[i-1] - A[i]
    A[i] = A[i-1]
    
print(sum)


### FIXED CODE ###

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

sum = 0

for i in range(1, len(A)):
  if A[i] < A[i-1]:
    sum += A[i-1] - A[i]
    A[i] = A[i-1]
    
print(sum)
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
for i in range(1,N):
  A[i]+=A[i-1]
for i in range(1,M):
  B[i]+=B[i-1]

j,best=0,0
for j in range(M):
  if B[j] > K: break
  else:best=j+1
j＝0
for i in range(N):
  if A[i] > K: break
  while j < M:
    if A[i]+B[j] > K: break
    else: j+=1
  best=max(best,i+1+j)
print(best)





### FIXED CODE ###

N,M,K=map(int,input().split())
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))
for i in range(1,N+1):
  A[i]+=A[i-1]
for i in range(1,M+1):
  B[i]+=B[i-1]

best=0
j=M
for i in range(0,N+1):
  while j>0:
    if A[i]+B[j]<=K:
      break
    else: j-=1
  if A[i]+B[j]<=K:
    best=max(best,i+j)
  pass
print(best)
N, K = [int(n) for n in input().split()]
A = [int(n) for n in input().split()]

A.sort()

res = []

for n_ex in range(N):
  dp = [[False] * K for n in range(N+1)]
  dp[0][0] = True
  for n in range(N):
    for k in range(0, K):
      dp[n+1][k] = dp[n][k]
    if n != n_ex:
      for k in range(0, K - A[n]):
        if dp[n][k] == True:
          dp[n+1][k+A[n]] = True
  for k in range(K-A[n_ex], K):
    if dp[N][k] == True:
      res.append(n_ex)
      break
print(N-len(res))

### FIXED CODE ###

a, b = input().split()
if a =='H':
  a = True
else:
  a = False
if b == 'H':
  b = True
else:
  b = False

res = not a^b

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

### FIXED CODE ###

a,b=map(int,input().split())
n=b-a-1
h=n*(n+1)/2
print(int(h-a))
a = input()

print(a**)

### FIXED CODE ###

r = int(input())

print(r * r)
A, op, B = input(),split()
if op is '+':
    print(int(A)+int(B))
if op is '-':
	print(int(A)-int(B))

### FIXED CODE ###

A, op, B = input().split()
if op is '+':
  print(int(A)+int(B))
if op is '-':
  print(int(A)-int(B))
import math
N,A,B=[int(i) for i in raw_input().split()]
if B-A % 2 ==0:
     print("Alice")
else:
     print("Borys")

### FIXED CODE ###

import math
N,A,B=[int(i) for i in raw_input().split()]
C=B-A
if C % 2 ==0:
     print("Alice")
else:
     print("Borys")
a = []
while True:
    x = map(raw_input().split())
    if x[1] == '?':
        break
    if x[1] == '+':
        a.append(int(x[0] + int(x[2])))
    if x[1] == '-':
        a.append(int(x[0] - int(x[2])))
    if x[1] == '*':
        a.append(int(x[0] * int(x[2])))
    if x[1] == '/':
        a.append(int(x[0] / int(x[2])))
for i in range(len(a)):
    print a[i]

### FIXED CODE ###

a = []
while True:
    x = map(str, raw_input().split())
    if x[1] == '?':
        break
    if x[1] == '+':
        a.append(int(x[0]) + int(x[2]))
    if x[1] == '-':
        a.append(int(x[0]) - int(x[2]))
    if x[1] == '*':
        a.append(int(x[0]) * int(x[2]))
    if x[1] == '/':
        a.append(int(x[0]) / int(x[2]))
for i in range(len(a)):
    print a[i]