Harryxun/stf_run huggingface dataset:
n = int(input())

flag = 0
for i in range(1, 10):
    m = n/i
    try:
        m = int(m)
        if m < 10:
          flag = 1
            print("Yes")
            break
    except:
        continue
if flag ==0:
    print("No")

### FIXED CODE ###

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False
  
n = int(input())

flag=0
for i in range(1, 10):
    m = n/i
    if is_integer_num(m) and m<10:
        flag = 1
        print("Yes")
        break
if flag == 0:
    print("No")
p=list(map(int,input().split()))
n=input()
result=sum(p)
for i in range(n-2):
    s1 = sum(p[:i+1])
    s2 = sum(p[i+1:])
    result = min(result,abs(s1-s2))
print(result)

### FIXED CODE ###

n=int(input())
p = list(map(int,input().split()))
result=sum(p)
for i in range(n-1):
    s1 = sum(p[:i+1])
    s2 = sum(p[i+1:])
    result = min(result,abs(s1-s2))
print(result)
n = int(input())

if n = 1:
  print("Hello World")
else:
  print(int(input())+int(input()))




### FIXED CODE ###

n = int(input())
 
if n == 1:
  print("Hello World")
else:
  print(int(input())+int(input()))
n = str(input())
a = n[0:-2]
tens = int(n[-2])
need = tens*2
ones = int(n[-1])
if ones < 5:
    need += 1
else:
    need +=2

if need <= int(a):
    print(1)
else:
    print(0)


### FIXED CODE ###

n = str(input())
if len(n) <= 2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones == 0:
        need +=0
    elif ones <= 5:
        need += 1
    else:
        need +=2
    if need <= int(a):
        print(1)
    else:
        print(0)
import sys
input = sys.stdin.readline
s=input().strip()
for i in range(len(s)):
    if s[i]=="A":
        sa=i
for i in range(len(s)):
    if s[i]=="Z":
        sz=i
print(len(s[si:sz+1]))


### FIXED CODE ###

import sys
input = sys.stdin.readline
s=input().strip()
for i in range(len(s)):
    if s[i]=="A":
        sa=i
        break
for i in range(len(s)):
    if s[i]=="Z":
        sz=i
print(len(s[sa:sz+1]))
n = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in range(n):
    if a[i] == 0:
        cnt -= 1000000000000
        break
    elif a[i] < 0:
        cnt += 1
a = [abs(a[i]) for i in range(n)]
if cnt < 0 or num % 2 == 0:
    print(sum(a))
else:
    print(sum(a) - 2*min(a))

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in range(n):
    if a[i] == 0:
        cnt -= 1000000000000
        break
    elif a[i] < 0:
        cnt += 1
a = [abs(a[i]) for i in range(n)]
if cnt < 0 or cnt % 2 == 0:
    print(sum(a))
else:
    print(sum(a) - 2*min(a))
n = int(input())
a = [int(input()) for _ in range(n)]
cnt = [0]*int(1e5+10)
for i in range(n) :
  cnt[a[i]] += 1
print(sum([cnt[i]%2 for i in range(len(cnt))]))

### FIXED CODE ###

n = int(input())
a = sorted([int(input()) for _ in range(n)])
tmp = a[0]
cnt = [0]*n
ptr = 0
for i in range(n) :
  if(a[i-1] != a[i]) :
    ptr += 1
  cnt[ptr] += 1
print(sum([cnt[i]%2 for i in range(len(cnt))]))
import itertools

n = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

p_index = -1
q_index = -1
combs = itertools.permutations(range(1, n + 1), n)
for index, each in enumerate(combs, start=1):
#    print(index, each)
    if P[0] == each[0] and P[1] == each[1] and P[2] == each[2]:
        p_index = index

    if Q[0] == each[0] and Q[1] == each[1] and Q[2] == each[2]:
        q_index = index
print(abs(p_index - q_index))


### FIXED CODE ###

import itertools

n = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

p_index = -1
q_index = -1
combs = itertools.permutations(range(1, n + 1), n)
for index, each in enumerate(combs):
    if all(P[i] == each[i] for i in range(n)):
        p_index = index

    if all(Q[i] == each[i] for i in range(n)):
        q_index = index
print(abs(p_index - q_index))
n = int(input())
a = []
a = input().split()
b = 1
for num in a:
  b = b * num
if b > 10**18:
  b = -1
print(b)

### FIXED CODE ###

N = int(input())
A = map(int, input().split())
 
res = 1
 
for a in sorted(A):
    res *= a
    if res > 10 ** 18:
        print("-1")
        exit()
print(res)
s = input()
cs = s
judge = True
while 0<len(cs): 
    if cs[:5]=='dream':
        cs = cs[5:]
        if cs[:2]=='er' and not cs[:5]=='erase':
            cs = cs[2:]
    elif cs[:5]=='erase':
        cs = cs[5:]
        if cs[0]=='r':
            cs = cs[1:]
    else:
        judge = False
        break
print('YES' if judge else 'NO')


### FIXED CODE ###

s = input()
judge = True
while 0<len(s): 
    if s[:5]=='dream':
        s = s[5:]
        if s[:2]=='er' and not s[:5]=='erase':
            s = s[2:]
    elif s[:5]=='erase':
        s = s[5:]
        if s[:1]=='r':
            s = s[1:]
    else:
        judge = False
        break
print('YES' if judge else 'NO')
N = int(input())
A = []
for i in range(N):
    A.append(input())

dic = {}
for i in range(N):
    temp = {}
    for j in range(10):
        if A[i][j] in temp:
            temp[A[i][j]] += 1
        else:
            temp[A[i][j]] = 1
    if dic in temp:
        dic[temp] += 1
    else:
        dic[temp] = 1
        
ans = 0    
for key in dic:
    if dic[key] > 1:
        ans += (dic[key]*(dic[key]-1)//2)

print(ans)

### FIXED CODE ###

N = int(input())
S = [input() for _ in range(N)]

L = ["0"]*N
for i in range(N):
    temp = ["0"]*10
    for j in range(10):
        temp[j] = S[i][j]
    temp.sort()
    L[i] = temp
        
L.sort()
ans = 0
cnt = 1
temp = L[0]
for i in range(1, N):
    if temp == L[i]:
        cnt += 1
    else:
        ans += cnt*(cnt-1)//2
        cnt = 1
        temp = L[i]
        
ans += cnt*(cnt-1)//2
print(ans)
# http://ja.wikipedia.org/wiki/%E3%83%97%E3%83%AA%E3%83%A0%E6%B3%95

class vertex:
    def __init__(self):
        self.is_in_V = False

def is_single_in_V(v,p):
    a = v[p[0]].is_in_V
    b = v[p[1]].is_in_V
    return ( a and not b ) or ( not a and b )

def all_in_V(v):
    for e in v:
        if not e.is_in_V:
            return False
    return True

def add_in_V(v,d):
    v[d[0]].is_in_V = True
    v[d[1]].is_in_V = True

def remove_all_in_V_pass(v,d):
    for i in xrange(len(d)):
        try:
            if v[d[i][0]].is_in_V and v[d[i][1]].is_in_V:
                d.pop(i)
        except:
            pass

def solve(nu,mu,du):
    E = []
    vertexes = [vertex() for i in xrange(nu)]
    vertexes[0].is_in_V = True

    while True:
        if all_in_V(vertexes):
            break
        min_dist,ind = float("inf"),float("inf")
        for i in xrange(len(du)):
            if is_single_in_V(vertexes,du[i][0:2]):
                if min_dist > du[i][2]:
                    min_dist = du[i][2]
                    ind = i
        E.append(min_dist)
        add_in_V(vertexes,du[ind])
        du.pop(ind)
        remove_all_in_V_pass(vertexes,du)
    print sum(E)/100 - len(E)

while True:
    n = input()
    if n == 0:
        exit()
    m = input()
    data = []
    for i in xrange(n):
        data.append( map(int,raw_input().split(",")) )
    solve(n,m,data)

### FIXED CODE ###

def solve(nu,mu,du):
    E = []
    vs = [False]*nu
    vs[0] = True

    while True:
        min_dist,ind = float("inf"),float("inf")
        for i in xrange(len(du)):
            if ( ( vs[du[i][0]] and not vs[du[i][1]] ) or ( not vs[du[i][0]] and vs[du[i][1]]) ) and min_dist > du[i][2]:
                min_dist,ind,pf,pt = du[i][2],i,du[i][0],du[i][1]
        E.append(min_dist)
        vs[pf] = vs[pt] = True
        du.pop(ind)
        if all(vs):
            break

        for i in xrange(len(du)):
            try:
                if vs[du[i][0]] and vs[du[i][1]]:
                    du.pop(i)
            except:
                pass

    print sum(E)/100 - len(E)

while True:
    n = input()
    if n == 0:
        exit()
    m = input()
    data = []
    for i in xrange(m):
        data.append( map(int,raw_input().split(",")) )
    solve(n,m,data)
def resolve():
    import numpy as np
    from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
    from scipy.sparse import csr_matrix
    n, x, y = map(int, input().split())
    netw = [[0]*n for _ in range(n)]
    for i in range(n):
        for j in range(n):
            if abs(j-i) == 1:
                netw[i][j] = 1
    netw[x-1][y-1] = 1
    netw[y-1][x-1] = 1
    netw = np.array(netw)
    csr = csr_matrix(netw)
    ans = {}
    for i in range(n-1):
        a = shortest_path(csr, indices=i)
        for j in range(i+1, n):
            if a[j] in ans:
                ans[a[j]] += 1
            else:
                ans[a[j]] = 1
    for i in range(1, n):
        if i in ans:
            continue
        else:
            ans[i] =0
    for i in range(1, n):
        print(ans[i])
resolve()

### FIXED CODE ###

def resolve():
    n,x,y = map(int, input().split())
    ans = {}
    for i in range(1, n):
        for j in range(i+1, n+1):
            dist1 = j-i
            dist2 = abs(x-i)+1+abs(y-j)
            dist =min (dist1, dist2)
            if dist in ans:
                ans[dist] += 1
            else:
                ans[dist] = 1
    for i in range(1,n):
        if i not in ans:
            ans[i] =0
        print(ans[i])
resolve()
N = int(input())
color = [-1] * N
G = [[] for _ in range(N)]
for i in range(N-1):
  u, v, w = map(int, input().split())
  G[u-1].append((v-1, w))
  G[v-1].append((u-1, w))

def dfs(v, cur):
  color[v] = cur
  for next_v, w in G[v]:
    if color[next_v] != -1:
      continue
    if w % 2 == 0:
      dfs(next_v, cur)
    else:
      dfs(next_v, 1 - cur)
      
dfs(0, 0)
for i in range(N):
  print(color[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

N = int(input())
color = [-1] * N
G = [[] for _ in range(N)]
W = [[] for _ in range(N)]
for i in range(N-1):
  u, v, w = map(int, input().split())
  G[u-1].append(v-1)
  G[v-1].append(u-1)
  W[u-1].append(w)
  W[v-1].append(w)

def dfs(v, cur):
  color[v] = cur
  for next_v, w in zip(G[v], W[v]):
    if color[next_v] != -1:
      continue
    if w % 2 == 0:
      dfs(next_v, cur)
    else:
      dfs(next_v, 1 - cur)
      
for i in range(N):
  if color[i] != -1:
    continue
  dfs(i, 0)
for i in range(N):
  print(color[i])
c=[x+' '+y for x in'SHCD'for y in range(1,14)
for _ in range(int(input())):
 c.remove(input())
print('\n'.join(c))

### FIXED CODE ###

n=int(input())
e=[input()for _ in[0]*n]
for s in"SHCD":
 for r in range(1,14):
  if f'{s} {r}'not in e:print(s,r)
import numpy as np
from numpy.fft import fft, ifft
from bisect import bisect_left
import sys
Max = 10**6
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = np.zeros(Max+1)
D = np.zeros(Max+1)
for a in A:
    C[a] +=1
for b in B:
    D[b]+=1
L = 2**8
res = ifft(fft(C, L)*fft(D, L))
res = np.where(res>1.5)
if res[0].size == 0:
    print(-1)
    sys.exit()
res = res[0][-1]
B.sort()
ans  = []
for i, a in enumerate(A):
    j = bisect_left(B, res-a)
    b = B[j]
    if b == res-a:
        ans.append(i)
        ans.append(j)
    if len(ans) == 4:
        break
if len(ans) < 4:
    print(liahbcon)
print(*ans)    
    


### FIXED CODE ###

import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())), dtype = np.int64)
a = np.bitwise_xor.reduce(A)
for i in range(60):
    bit = 1<<i
    if bit & a:
        A^=(A&bit)
for k in range(60, -1, -1):
    bit = 1<<k
    one = (A&bit != 0)
    i = np.where(one & (A < (1<<(k+1))))[0]
    if len(i) == 0:
        continue
    i = i[0]
    x = A[i]
    A[one]^=x
    A[i] = x
b = np.bitwise_xor.reduce(A)
a^=b
print(a+b)
n,m = map(int(input().split()))
if abs(n-m) < 2:
  print('Brown')
else:
  print('Alice')

### FIXED CODE ###

n,m = map(int,input().split())
if abs(n-m) < 2:
  print('Brown')
else:
  print('Alice')
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
AGC028 A
"""

import math

n, m = map(int, input().split())
s = input()
t = input()

g = math.gcd(n, m)
lcm = (n*m//g)

flag = True
for i in range(g):
    if s[i*lcm//m] != t[i*lcm//n]:
        flag = False
        break

if flag:
    print(lcm)
else:
    print(-1)






### FIXED CODE ###

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
AGC028 A
"""

import fractions

n, m = map(int, input().split())
s = input()
t = input()

g = fractions.gcd(n, m)
lcm = (n*m//g)

flag = True
for i in range(g):
    if s[i*lcm//m] != t[i*lcm//n]:
        flag = False
        break

if flag:
    print(lcm)
else:
    print(-1)
ID=0
def dfs(row,col):
    global ID
    if islands[row][col]==1:
        islandsID[row][col]==ID
        if row<11:
            dfs(row+1,col)
        if row>0:
            dfs(row-1,col)
        if col<11:
            dfs(row,col+1)
        if col>0:
            dfs(row,col-1)

while True:
    c=0
    islands=[]
    islandsID=[]
    for i in range(12):
        islands.append(list(map(int,input().split())))
    for _ in range(12):
        islandsID.append([0 for i in range(12)])
    
    for i in range(12):
        for j in range(12):
            if islands[i][j]==1 and islandsID[i][j]==0:
                ID+=1
            dfs(i,j)
    print(ID)
    try:
        c=input()
    except:
        break


### FIXED CODE ###

while True:
    c=0
    islands=[]
    islandsID=[]
    ID=0

    def dfs(row,col):
        global ID
        if 0<=row<12 and 0<=col<12:
            if islands[row][col]==1 and islandsID[row][col]==0:
                islandsID[row][col]=ID
                for dr, dc in [[0,1],[1,0],[0,-1],[-1,0]]:
                    dfs(row+dr,col+dc)

    for i in range(12):
        islands.append(list(int(k) for k in input()))
    for _ in range(12):
        islandsID.append([0 for i in range(12)])

    for i in range(12):
        for j in range(12):
            if islands[i][j]==1 and islandsID[i][j]==0:
                ID+=1
                dfs(i,j)
    print(ID)
    try:
        c=input()
    except:
        break
n = list(map(int, input().split()))
a = input()


if a[n[1]] == "A":
    a[n[1]] ="a"
if a[n[1]] == "B":
    a[n[1]] ="b"
if a[n[1]] == "C":
    a[n[1]] ="c"

### FIXED CODE ###

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


if a[n[1]-1] == "A":
    a[n[1]-1] = "a"
if a[n[1]-1] == "B":
    a[n[1]-1] = "b"
if a[n[1]-1] == "C":
    a[n[1]-1] = "c"
    
ch = ""
for i in a:
    ch += str(i)
print(ch)
dict_ = dict()
[exec("dict_['{0}'] = dict_.get('{0}', 0) + 1".format(input())) for _ in range(int(input()))]
[exec("dict_['{0}'] = dict_.get('{0}', 0) - 1".format(input())) for _ in range(int(input()))]
print(max(*dict_.values(), 0))


### FIXED CODE ###

nblues = int(input())
profits = dict()
for _ in range(nblues):
    word = input().rstrip("\n")
    profits[word] = profits.get(word, 0) + 1

nreds = int(input())
for _ in range(nreds):
    word = input().rstrip("\n")
    profits[word] = profits.get(word, 0) - 1

print(max(0, max(profits.items(), key=lambda t: t[1])[1]))
def noboru(m):
    if (m == 1):
        return 1
    elif (m == 2):
        return 2
    else:
        return noboru(m-1)+noboru(m-2)

def func(N, M, a):
    ans = 1
    i = 0
    if (a[0] == 1):
        ans *=1
    else:
        ans *= noboru(a[0]-1)
    if (M > 1):
        for i in range(1, M):
            if (a[i] == a[i-1]+1):
                return 0
            else:
                ans *= noboru(a[i] - a[i-1] -2)
    ans *= noboru(N - a[i] -1)
    return ans

N, M = map(int, input().split(" "))
a = [int(input()) for _ in range(M)]
#A_i = list(map(int, input().split(" ")))
#B_i = list(map(int, input().split(" ")))
print(func(N, M, a) % 1000000007)
#print(noboru(6))

### FIXED CODE ###

CONST = 1000000007

def noboru(n):
    a1 = 1
    a2 = 2
    ans = 0
    if (n == 0 or n == 1): return a1
    elif (n == 2): return a2
    else:
        for i in range(1, n-1):
            ans = a2 + a1
            a1 = a2
            a2 = ans
        return a2

def func(N, M, a):
    ans = 1
    pos = 0
    for i in range(M):
        if (pos == a[i]):
            return 0
        else:
            ans = (ans * noboru(a[i] - pos - 1)) % CONST
            pos = a[i] + 1
    ans = (ans * noboru(N - pos)) % CONST
    return ans

N, M = map(int, input().split(" "))
a = [int(input()) for _ in range(M)]
print(func(N, M, a))
S = input()
K = int(input())

for i in S[K+1]:
    if i != "1":
        print(i)
        break
else:
    print(i)

### FIXED CODE ###

S = input()
K = int(input())

count = 0
while count < K:
    if S[count] != "1":
        print(S[count])
        break
    count += 1
else:
    print("1")
import math
A=int(input())
c=0
d=100
while(1):
  d=math.floor(d*1.01)
  c+=1
  if d>A:
    print(c)

### FIXED CODE ###

import math
A=int(input())
c=0
d=100
while(1):
  d=math.floor(d*1.01)
  c+=1
  if d>=A:
    print(c)
    break
from collections import Counter
    
n = int(input())
v = list(map(int, input().split()))

a = Counter(v[0::2]).most_common()
b = Counter(v[1::2]).most_common()
print(a)
print(b)
a.append([0,0])
b.append([0,0])
if a[0][0] != b[0][0]:
  print(n-(a[0][1]+b[0][1])
else:
  print(min(n-(a[0][1]+b[1][1]),n-(a[1][1]+b[0][1])))

### FIXED CODE ###

from collections import Counter
    
n = int(input())
v = list(map(int, input().split()))

a = Counter(v[0::2]).most_common()
b = Counter(v[1::2]).most_common()
a.append([0,0])
b.append([0,0])
if a[0][0] != b[0][0]:
  print(n-(a[0][1]+b[0][1]))
else:
  print(min(n-(a[0][1]+b[1][1]),n-(a[1][1]+b[0][1])))
N,M=[int(x) for x in input().split()]
print(min(abs(N-N//M*M),abs(N-(N//M+1)*(M))))N,M=[int(x) for x in input().split()]
print(min(abs(N-N//M*M),abs(N-(N//M+1)*(M))))

### FIXED CODE ###

N,M=[int(x) for x in input().split()]
print(min(abs(N-N//M*M),abs(N-(N//M+1)*M)))
n, x, y = map(int, input().split())
x -= 1
y -= 1

ans = [0] * n
for i in range(n):
    for j in range(i + 1, n):
        d = min(abs(i - j),
                abs(i - x) + 1 + abs(y - j),
                abs(i - y) + 1 + abs(x - j))
        ans[dist[i][j]] += 1

for k in range(1, n):
    print(ans[k])


### FIXED CODE ###

from heapq import heappush, heappop


def dijkstra(graph: list, n: int, v_s: int, INF: int = float('inf')) -> list:
    # graph[v_from] = [v_to, ...]
    dist = [INF] * n

    dist[v_s] = 0
    heap = [(0, v_s)]  # heap = [(dist[v], v), ...]
    while heap:
        _, v_from = heappop(heap)
        for v_to in graph[v_from]:
            dist_cand = dist[v_from] + 1
            if dist_cand < dist[v_to]:
                dist[v_to] = dist_cand
                heappush(heap, (dist[v_to], v_to))
    return dist


n, x, y = map(int, input().split())
x -= 1
y -= 1
g = [[] for _ in range(n)]
for i in range(n):
    if i - 1 >= 0:
        g[i].append(i - 1)
    if i + 1 < n:
        g[i].append(i + 1)
g[x].append(y)
g[y].append(x)

d = [dijkstra(g, n, i) for i in range(n)]
# print(*d, sep='\n')

ans = [0] * n
for i in range(n):
    for j in range(i + 1, n):
        ans[d[i][j]] += 1

for k in range(1, n):
    print(ans[k])
w,a,b=map(int,input().split())
print(max(abs(s-b)-w,0))

### FIXED CODE ###

w,a,b=map(int,input().split())
print(max(abs(a-b)-w,0))
M, N = map(int, input().split())
p = list(map(int, input().split()))
pairs = []
for i in range(0,N):
    pairs.append(list(map(int, input().split())))
allset= set(range(1,M+1))
score = 0
while (allset):
    n = {allset.pop()}
    for i in pairs:
        if (n & set(i)):
            n = n | set(i)
            pairs.remove(i)
    for i in pairs:
        if (n & set(i)):
            n = n | set(i)
    for i in list(n):
        if p[i-1] in n:
            score += 1
    allset = (allset - (allset & n))
print(score)

### FIXED CODE ###

a, b, c, d = map(int, input().split())
if abs(a - c) <= d or (abs(a - b) <= d and abs(b - c) <= d):
    print('Yes')
else:
    print('No')
num = input()
print(num ** 3)

### FIXED CODE ###

num = input()
print(int(num) ** 3)
import sys


def resolve():
    read = sys.stdin.read

    s, t = read().split('\n')
    
    # 配るDP
    # dp[i + 1][j + 1]はsのi文字目までとtのj文字目までのLCSの長さ
    # LCS=最長共通部分列問題
    dp = [[0] * (len(t) + 1) for _ in [0] * (len(s) + 1)]
    
    for i in range(len(s)):
        for j in range(len(t)):
            if s[i] == t[j]:
                dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j] + 1)
            dp[i + 1][j + 1] = max(dp[i + 1][j + 1],
                                   dp[i + 1][j],
                                   dp[i][j + 1])

    # LCSを求めたDPから部分文字列を復元
    res = ''
    i, j = len(s), len(t)
    while i > 0 and j > 0:
        if dp[i][j] == dp[i - 1][j]:
            i -= 1
        elif dp[i][j] == dp[i][j - 1]:
            j -= 1
        else:
            res += s[i - 1]
            i -= 1
            j -= 1
    print(res[::-1])
    

resolve()


### FIXED CODE ###

def resolve():
    import sys
    def max2(a: int, b: int):
        """
        入力された2つの整数a,bの大きいほうを返す
        Parameters
        ----------
        a, b : int
            比較したい整数
        Returns
        -------
        a or b : int
            大きいほうの整数
        """
        if a >= b:
            return a
        else:
            return b
    
    readline = sys.stdin.readline
 
    s = readline()
    t = readline()
 
    # 配るDP
    # dp[i + 1][j + 1]はsのi文字目までとtのj文字目までのLCSの長さ
    # LCS=最長共通部分列問題
    dp = [[0] * (len(t) + 1) for _ in [0] * (len(s) + 1)]
 
    for i in range(len(s)):
        for j in range(len(t)):
            if s[i] == t[j]:
                dp[i + 1][j + 1] = max2(dp[i + 1][j + 1], dp[i][j] + 1)
            dp[i + 1][j + 1] = max2(dp[i + 1][j + 1], dp[i + 1][j])
            dp[i + 1][j + 1] = max2(dp[i + 1][j + 1], dp[i][j + 1])
 
    # LCSを求めたDPから部分文字列を復元
    res = []
    i, j = len(s), len(t)
    while i > 0 and j > 0:
        if dp[i][j] == dp[i - 1][j]:
            i -= 1
        elif dp[i][j] == dp[i][j - 1]:
            j -= 1
        else:
            res.append(s[i - 1])
            i -= 1
            j -= 1
    print(''.join(res[::-1]))
 
 
resolve()
//============================================================================
// Name        : HelloWorld.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include<algorithm>
using namespace std;

int main() {
	int n,m,x,y;
	int X[1000],Y[1000];
	cin>>n>>m>>x>>y;
	for(int i=0;i<n;i++){
		cin>>X[i];
	}
	for(int j=0;j<m;j++){
		cin>>Y[j];

	}
	int X_max=-1000;
	int Y_min=1000;
	for(int i=0;i<n;i++){
		if(X_max<X[i]){
			X_max=X[i];
		}
	}
	for(int j=0;j<m;j++){
		if(Y[j]<Y_min){
			Y_min=Y[j];
		}
	}

	for(int k=x;k<y;k++){
		if(X_max<=k && k<=Y_min){
			cout<<"No War"<<endl;
			return 0;
		}

	}
	cout<<"War"<<endl;



}


### FIXED CODE ###

n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a_max=max(a)
b_min=min(b)
for i in range(x+1,y+1):
    if a_max<i and i<=b_min:
        print("No War")
        exit()
print("War")