qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial#, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    sn = s_input()
    n = int(sn)

    compare_num = int(sn[0]) * 100 + int(sn[0]) * 10 + int(sn[0])
    
    if n == compare_num:
        print(n)
    elif n > compare_num:
        print(int(sn[0])+1 * 100 + int(sn[0])+1 * 10 + int(sn[0])+1)
    else:
        print(compare_num)

if __name__ == '__main__':
    main()


Fixed code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial#, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    sn = s_input()
    n = int(sn)

    compare_num = int(sn[0]) * 100 + int(sn[0]) * 10 + int(sn[0])
    
    if n == compare_num:
        print(n)
    elif n > compare_num:
        tmp = int(sn[0]) + 1
        print(tmp * 100 + tmp * 10 + tmp)
    else:
        print(compare_num)

if __name__ == '__main__':
    main()
Buggy code:
N = int(input())
ans = 0
a = N // 100
N -= 100*a
b = N // 10
N -= 10*b
c = N

if max(a, b, c) == a:
    ans = 100*a + 10*a + a
elif max(a, b, c) == b:
    a_ = a + 1
    ans = 100*a_ + 10*a_ + a_
else:
    if a >= b:
        ans = 111 * a
    else:
        a_ = a + 1
        ans = 100*a_ + 10*a_ + a_

print(ans)

Fixed code:
N = int(input())
ans = 0
a = N // 100
N -= 100*a
b = N // 10
N -= 10*b
c = N

if max(a, b, c) == a:
    ans = 100*a + 10*a + a
elif max(a, b, c) == b:
    a_ = a + 1
    ans = 100*a_ + 10*a_ + a_
else:
    if a > b:
        ans = 111 * a
    elif a == b:
        a_ = a + 1
        ans = 111 * a_
    else:
        a_ = a + 1
        ans = 100*a_ + 10*a_ + a_

print(ans)
Buggy code:
n = int(input())
ans = 0

while n > ans:
    ans += ans
print(ans)

Fixed code:
n = int(input())
ans = 0

while n > ans:
    ans += 111
print(ans)
Buggy code:
N = input()

if int(N) < int(N[0] * 3):
    print(int(N[0] * 3))
else:
    print(int((N[0] + 1) * 3))

Fixed code:
N = input()
 
if int(N) <= int(N[0] * 3):
    print(int(N[0] * 3))
else:
    print(int(str((int(N[0]) + 1)) * 3))
Buggy code:
def piyo():
    n = int(input())
    hoge = n//100
    if int(str(hoge)+str(hoge))>n%100:
        a = int(str(hoge)+str(hoge)+str(hoge))
    else:
        hoge+=1
        a = int(str(hoge)+str(hoge)+str(hoge))
    print(a)

if __name__ == '__main__':
    piyo()

Fixed code:
def piyo():
    n = int(input())
    hoge = n//100
    if int(str(hoge)+str(hoge))>=n%100:
        a = int(str(hoge)+str(hoge)+str(hoge))
    else:
        hoge+=1
        a = int(str(hoge)+str(hoge)+str(hoge))
    print(a)

if __name__ == '__main__':
    piyo()
Buggy code:
n=int(input())
c=n%10
b=int(((n-c)%100)/10)
a=int(((n-b-c)%1000)/100)
x=a*100+a*10+a
if b < a:pass
elif b==a and c<b:pass
else:x+=111
print(x)

Fixed code:
n=int(input())
c=n%10
b=int(((n-c)%100)/10)
a=int(((n-b-c)%1000)/100)
x=a*100+a*10+a
if b < a:pass
elif b==a and c<b:pass
elif a==b and b==c:pass
else:x+=111
print(x)
Buggy code:
N=input()
zoro=int(N[0])*100+int(N[0])*10+int(N[0])
zoro_up=(int(N[0])+1)*100+(int(N[0])+1)*10+(int(N[0])+1)
if int(N)<zoro:
    print(zoro)
else:
    print(zoro_up)

Fixed code:
N=input()
zoro=int(N[0])*100+int(N[0])*10+int(N[0])
zoro_up=(int(N[0])+1)*100+(int(N[0])+1)*10+(int(N[0])+1)
if int(N)<=zoro:
    print(zoro)
else:
    print(zoro_up)
Buggy code:
n=int(input())
a=n%111
if a==0:
   print(a)
else:
   print(((a//111)+1)*111)

Fixed code:
a = int(input())

if a%111==0:
  print(a)
else:
  print(111*(1+a//111))
Buggy code:
a=input()
if int(a) < int(a[0])*111:
  print(int(a[0])*111)
else:
  print((int(a[0])+1)*111

Fixed code:
a=input()
if int(a) <= int(a[0])*111:
  print(int(a[0])*111)
else:
  print((int(a[0])+1)*111)
Buggy code:
N = int(input())
A = N//100

print((A*111) if N < A*111 else (A+1)*111)

Fixed code:
N = int(input())
A = N//100

print((A*111) if N <= A*111 else (A+1)*111)
Buggy code:
N=input()
if int(N[0]*3)>int(N):
  print(int(N[0]*3))
else:
  print(int(str(int(N[0])+1)*3))

Fixed code:
N=input()
if int(N[0]*3)>=int(N):
  print(int(N[0]*3))
else:
  print(int(str(int(N[0])+1)*3))
Buggy code:
N=int(input)
a=N%111
if a==0:
   print(a*111)
else:
  b=N//111
  c=b+1
  print(c*111)
      

Fixed code:
N=int(input())
a=N%111
if a==0:
   print(N)
else:
  b=N//111
  c=b+1
  print(c*111)
Buggy code:
n=int(input())
while n%111==0:
    n = n+1
print(n)

Fixed code:
n=int(input())
while n%111!=0:
    n = n+1
print(n)
Buggy code:
n = int(input())
while True:
    if n%10 == n//10%10 == n // 100:
        print(n)
    else:
        n += 1

Fixed code:
n = int(input())
while True:
    if n%10 == n//10%10 == n // 100:
        print(n)
        break
    else:
        n += 1
Buggy code:
n = int(input())+100
o = int((n-(n%100))/100*111)
if n < o:
	print(o)
else:
	print(o+111)

Fixed code:
n = int(input())
o = int((n-(n%100))/100)
if n<=o*111:
    print(o*111)
else:
    print(o*111+111)
Buggy code:
A = input()
AAA = int(A[0]*3)
if AAA > int(A):
  print(AAA)
else:
  print(AAA + 111)
  

Fixed code:
A = input()
AAA = int(A[0]*3)
if AAA >= int(A):
  print(AAA)
else:
  print(AAA + 111)
Buggy code:
line = int(input())
lina = list(map(int, [line/100, (line/10)%10, line%10]))
contest = [111*lina[0], 111*(lina[0]+1)]
if(contest[0] - line > 0):
    print(contest[0])
else:
    print(contest[1])

Fixed code:
line = int(input())
lina = list(map(int, [line/100, (line/10)%10, line%10]))
contest = [111*lina[0], 111*(lina[0]+1)]
if(contest[0] - line >= 0):
    print(contest[0])
else:
    print(contest[1])
Buggy code:
n=int(input())
if n%111:
	print(n/111*111)
else:
	print((n/111+1)*111)

Fixed code:
n=int(input())
if n%111==0:
	print(int(n/111)*111)
else:
	print((n//111+1)*111)
Buggy code:
n = int(input())
num = n // 111
print(111 * (num + 1))

Fixed code:
n = int(input())
num = (n-1) // 111
print(111 * (num + 1))
Buggy code:
n=int(input())
for i in range(n,1000):
  if n%100 == n//10:
    print(n)

Fixed code:
n=int(input())

for i in range(n,1000):
      if i%10==(i%100)//10==i//100:
            print(i)
            exit()
Buggy code:
print((1+(int(input()-1)//111))*111)

Fixed code:
print((1+((int(input())-1))//111)*111)
Buggy code:
n = int(input())
i = int(n / 111)
if n % 111 != 0:
    i += 1
    print(i)
print(i * 111)

Fixed code:
n = int(input())
i = int(n / 111)
if n % 111 != 0:
    i += 1
print(i * 111)
Buggy code:
a = input()
b = list(a)
c = b[0] + b[0] + b[0]

if int(a) >= int(c):
  print(c)
else:
  print(int(c)+111)

Fixed code:
a = input()
b = list(a)
c = b[0] + b[0] + b[0]

if int(a) > int(c):
  print(int(c)+111)
else:
  print(int(c))
Buggy code:
a = input()
print((((a-1)//111)+1)*111)

Fixed code:
a = int(input())
print((((a-1)//111)+1)*111)
Buggy code:
n=int(input())

a=n//100
b=(n-a*100)//10
c=n-a-b

if a==b:
    if a<c:
        print((a+1)*100+(a+1)*10+a+1)
    elif c<a:
        print(a*100+a*10+a)
    else:
        print(n)
elif a<b:
    print((a+1)*100+(a+1)*10+a+1)
elif a>b:
    print(a*100+a*10+a)


Fixed code:
n=int(input())

a=n//100
b=(n-a*100)//10
c=n-a*100-b*10

if a==b:
    if a<c:
        print((a+1)*100+(a+1)*10+a+1)
    elif c<a:
        print(a*100+a*10+a)
    elif a==c:
        print(n)
elif a<b:
    print((a+1)*100+(a+1)*10+a+1)
elif a>b:
    print(a*100+a*10+a)
Buggy code:
N = int(input())

S = ((N//111)+1)*111

print(S)


Fixed code:
N = int(input())

S = (((N-1)//111)+1)*111

print(S)
Buggy code:
a = int(input())

for i in range(10):
	if a<i*111:
		print(i*111)
		break





Fixed code:
a = int(input())

for i in range(10):
	if a<=i*111:
		print(i*111)
		break
Buggy code:
N=int(input())
a=N//100
b=(N-a*100)//10
c=N-a*100-b*10
if a<b:
    N=(a+1)*111
elif a>b:
    N=a*111
elif a=b and a>=c:
    N=a*111
elif :
    N=(a+1)*111
print(N)
    

Fixed code:
N=int(input())
a=N//100
b=(N-a*100)//10
c=N-a*100-b*10
if a<b:
    N=(a+1)*111
elif a>b:
    N=a*111
elif a==b and a>=c :
    N=a*111
elif a==b and a<c :
    N=(a+1)*111
print(N)
Buggy code:
n = int(input())
for i in range(n, 1000):
  if i % 111 = 0:
    print(i)
    exit()


Fixed code:
n = int(input())
for i in range(n, 1000):
  if i % 111 == 0:
    print(i)
    exit()
Buggy code:
n = int(input())

if n // 111 == 0:
  print(n)
else:
  print(int((n//111 + 1)*111))

Fixed code:
n = int(input())

if n % 111 == 0:
  print(n)
else:
  print(int((n//111 + 1)*111))
Buggy code:
n = input()
x = (n - 1) // 111 + 1
print(x * 111)


Fixed code:
n = int(input())
x = (n - 1) // 111 + 1
print(x * 111)
Buggy code:
N=int(input())
a = N//100+N//100*10+N//100
b = (N//100+1)*100+(N//100+1)*10+(N//100+1)
print(a*(N<=a)+b*(N>a))

Fixed code:
N=int(input())
a = N//100*100+N//100*10+N//100
b = (N//100+1)*100+(N//100+1)*10+(N//100+1)
print(a*(N<=a)+b*(N>a))
Buggy code:
N = int(input())

if N % 111 == 0:
  print (N)
else:
  print((math.floor(N / 111) + 1) * 111 )

Fixed code:
import math
N = int(input())

if N % 111 == 0:
  print (N)
else:
  print((math.floor(N / 111) + 1) * 111 )
Buggy code:
n = int(input())

ans_list = [100*x+10*x+x for x in range(10)]

for v in ans_list:
    if v > n:
        ans = v
        break
        
print(ans)

Fixed code:
n = int(input())

ans_list = [100*x+10*x+x for x in range(10)]

for v in ans_list:
    if v >= n:
        ans = v
        break
        
print(ans)
Buggy code:
N = int(input())
if N % 111 == 0:
  print(N)
for i in range(10):
  if N // 111 = i:
    print(111 * (i + 1) )

Fixed code:
N = int(input())
if N % 111 == 0:
  print(N)
for i in range(10):
  if N % 111 != 0 and N // 111 == i:
    print(111 * (i + 1) )
Buggy code:
n = int(input())
print(((n//111)+1)*111)

Fixed code:
n = int(input())
print((((n-1)//111)+1)*111)
Buggy code:
a = int(input())
b = int(a /100)
if a > (100*b + 10*b +b -1):
    print(100*(b+1) + 10*(b+1) +b +1)
else:
    print(100*b + 10*b + b)

Fixed code:
a = int(input())
b = int(a /100)
if a > (100*b + 10*b +b ):
    print(100*(b+1) + 10*(b+1) +b +1)
else:
    print(100*b + 10*b + b)
Buggy code:
N=int(input())

a=N%10
N/=10
b=N%10
N/=10
c=N%10

d=1
a=a+1
if(a==b and a>=c or a>b):a=a-1

d=a*100+a*10+a
print(d)

Fixed code:
N=int(input())

c=N%10
N//=10
b=N%10
N//=10
a=N%10

d=1
if((a==b and b>=c )or a>b):
    a=a-1
a=a+1
d=a*100+a*10+a
print(d)
Buggy code:
N = int(input())

if N//111 == 0:
  print(N)
else:
  print((N//111 + 1) * 111)

Fixed code:
N = int(input())

if N % 111 == 0:
  print(N)
  
else:
  print((N //111 +1) *111)
Buggy code:
n = int(input())
print((n // 111 + 1) * 111)


Fixed code:
n = int(input())

print(((n-1) // 111 + 1) * 111)
Buggy code:
n = int(input())

for i in range(n,1000):
 if i % 111 == 0:
  print(i)

Fixed code:
n = int(input())
 
for i in range(n,1000):
 if i % 111 == 0:
  print(i)
  break
Buggy code:
n=int(input())
print(111 if (n//111)==0 else 111*(n//111+1) )

Fixed code:
n=int(input())
print(n if n%111==0 else 111*(n//111+1) )
Buggy code:
N = input()
x = N[0]
xxx = int(3*x)
if N <= XXX:
  print(xxx)
else:
  x = int(x)+1
  print(100*x + 10*x + x)

Fixed code:
N = input()
x = N[0]
xxx = int(3*x)
if int(N) <= xxx:
  print(xxx)
else:
  x = int(x)+1
  print(100*x + 10*x + x)
Buggy code:
N = input()
print(N[0]*3) if N[1] <= N[0] else print(str(int(N[0])+1)*3)

Fixed code:
N = input()
print(str(int(N[0])+1)*3) if int(N[0] * 3) < int(N) else print(int(N[0]*3))
Buggy code:
import sys

N = sys.stdin.readline().strip()
N = int(N)

M = math.ceil(N / 111.0)
M = int(M * 111)


print(M)

Fixed code:
import sys
import math
 
N = sys.stdin.readline().strip()
N = int(N)
 
M = math.ceil(N / 111.0)
M = int(M * 111)

print(M)
Buggy code:
n = int(input())
x = n//111+1
print(100*x+10*x+x)

Fixed code:
n = int(input())
x = (n-1)//111+1
print(100*x+10*x+x)
Buggy code:
print(111*(int(input())//111+1))

Fixed code:
print(111*((int(input())-1)//111+1))
Buggy code:
N = int(input())

if(N%111 == 0):
  N += 1
else:
  print(((N // 111) + 1) * 111)


Fixed code:
N=int(input())
if N % 111 ==0:
    print(N)
else:
    print(((N//111)+1)*111)
Buggy code:
n = input()
one = list(n)[0]
base = int(one) * 111
if int(n) > base:
  print(int(n)+111)
else:
  print(int(n))

Fixed code:
n = input()
one = list(n)[0]
base = int(one) * 111
if int(n) > base:
  print(base+111)
else:
  print(base)
Buggy code:
N = int(input())
i = int(N/111)
if N % 111 != 0:
  i = i + 1
else:
  i = 1
print(i)

Fixed code:
N = int(input())
i = int(N/111)
if N % 111 != 0:
  i = i + 1
else:
  i = i
print(i*111)
Buggy code:
import math

n = int(input())
print(math.ceil(n / 111))


Fixed code:
import math

n = int(input())
print(math.ceil(n / 111) * 111)
Buggy code:
print((int(input()) + 110) / 111 * 111)

Fixed code:
print(((int(input()) + 110) // 111) * 111)
Buggy code:
import math
import copy
import sys

def zorome(num):
    return int(111*num)

inputa = input().split()
# inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputaList = [int(n) for n in inputa]

# inputb = input().split()
# inputbList = [int(n) for n in inputb]
#
# inputList = []
# inputNumList = []
# for i in range(a):
#     inputNum = input().split()
#     inputNumList = list(inputNum[0])
#     inputList.append(inputNumList)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

listNum = list(str(a))

if int(a) >= zorome(int(listNum[0])):
    print(zorome(int(listNum[0])))
else:
    print(zorome(int(listNum[0])+1))





Fixed code:
import math
import copy
import sys

def zorome(num):
    return int(111*num)

inputa = input().split()
# inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputaList = [int(n) for n in inputa]

# inputb = input().split()
# inputbList = [int(n) for n in inputb]
#
# inputList = []
# inputNumList = []
# for i in range(a):
#     inputNum = input().split()
#     inputNumList = list(inputNum[0])
#     inputList.append(inputNumList)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

listNum = list(str(a))

if int(a) <= zorome(int(listNum[0])):
    print(zorome(int(listNum[0])))
else:
    print(zorome(int(listNum[0])+1))
Buggy code:
n = int(input())

print((n//111 + 1)*111)

Fixed code:
n = int(input())

print(((n-1)//111 + 1)*111)
Buggy code:
strN = input()
n = int(strN)
for i in range(n,n + 100):
    if i % 111 == 0:
        print(i)
        exit()

Fixed code:
strN = input()
n = int(strN)
for i in range(n,n + 111):
    if i % 111 == 0:
        print(i)
        exit()
Buggy code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
strN = list(str(N))
a = int(strN[0]*3)
if N > a:
    ans = str(int(strN[0])+1)*3
else:
    ans = a

print(a)



Fixed code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
strN = list(str(N))
a = int(strN[0]*3)
if N > a:
    ans = str(int(strN[0])+1)*3
else:
    ans = a

print(ans)
Buggy code:
n = int(input())
t = int(str(n)[0])
if n < (100*t+10*t+t):
    print(100*t+10*t+t)
else:
    print(100*(t+1)+10*(t+1)+t+1)
    

Fixed code:
n = int(input())
t = int(str(n)[0])
if n-1 < (100*t+10*t+t):
    print(100*t+10*t+t)
else:
    print(100*(t+1)+10*(t+1)+t+1)
Buggy code:
n = int(input())
if n%111 = 0:
  print(n)
else:
  print((n//111+1)*111)

Fixed code:
n = int(input())
if n%111 == 0:
    print(n)
else:
    print((n//111+1) * 111)
Buggy code:
n=int(input()
print((n-1)//111+111))

Fixed code:
n=int(input())
print((((n-1)//111)+1)*111)
Buggy code:
# ABC 110 , B
tmp = [int(el) for el in input().split(' ')]
n = tmp[0]
m = tmp[1]
x = tmp[2]
y = tmp[3]

X = [int(el) for el in input().split(' ')]
Y = [int(el) for el in input().split(' ')]

for z in range(x+1, y+1):
    if max(X) < z and min(Y) >= z:
        print(z)
        print('No War')
        break
else:
    print('War')


Fixed code:
# ABC 110 , B
tmp = [int(el) for el in input().split(' ')]
n = tmp[0]
m = tmp[1]
x = tmp[2]
y = tmp[3]

X = [int(el) for el in input().split(' ')]
Y = [int(el) for el in input().split(' ')]

for z in range(x+1, y+1):
    if max(X) < z and min(Y) >= z:
        print('No War')
        break
else:
    print('War')
Buggy code:
N, M, X, Y = map(int, input().split())

xs = list(map(int, input().split()))
ys = list(map(int, input().split()))

if (max(xs) < min(ys)) ans (X < Y):
    print("No War")
else:
    print("War")

Fixed code:
N, M, X, Y = map(int, input().split())

xs = list(map(int, input().split()))
xs.append(X)
ys = list(map(int, input().split()))
ys.append(Y)

if max(xs) < min(ys):
    print("No War")
else:
    print("War")
Buggy code:
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')

Fixed code:
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')
Buggy code:
N, M , X ,Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

max_x = max(x)
max_y = max(y)
#print(max_x)
#print(max_y)
#print(Y-X)

XY_list = []
xy_list = []
for i in range(X+1, Y+1):
    XY_list.append(i)

if max_x + 1  >= max_y:
    print("War")
    exit()

for i in range(max_x, max_y+1):
    xy_list.append(i)

#print(XY_list)
#print(xy_list)
set_XY = set(XY_list)
set_xy = set(xy_list)

print("No War" if set_XY in set_xy else "War")




Fixed code:
N, M , X ,Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

max_x = max(x)
max_y = max(y)
min_y = min(y)
#print(max_x)
#print(max_y)
#print(Y-X)

XY_list = []
xy_list = []
for i in range(X+1, Y+1):
    XY_list.append(i)

if max_x   >= min_y:
    print("War")
    exit()

for i in range(max_x +1, min_y+1):
    xy_list.append(i)

#print(XY_list)
#print(xy_list)
set_XY = set(XY_list)
set_xy = set(xy_list)

print("No War" if set_XY & set_xy else "War")
Buggy code:
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F551C':
    sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N, M, X, Y = read_int_list()
    x = read_int_list()
    y = read_int_list()
    if max(x) < min(y):
        res = 'No War'
    else:
        res = 'War'
    print(res)


main()


Fixed code:
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F551C':
    sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N, M, X, Y = read_int_list()
    x = read_int_list()
    y = read_int_list()
    x.append(X)
    y.append(Y)
    if max(x) < min(y):
        res = 'No War'
    else:
        res = 'War'
    print(res)


main()
Buggy code:
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 max(_x) >= min(_y):
	print("War")
elif X > min(_y):
	print("War")
elif max(_x) >= Y:
	print("War")
else:
	print("No War")

Fixed code:
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 max(_x) >= min(_y):
	print("War")
elif X >= min(_y):
	print("War")
elif Y <= max(_x):
	print("War")
else:
	print("No War")
Buggy code:
i=lambda:map(int,input().split());n,m,x,y=i();print("No"*(max(x,max(i()))<min(min(i()),y))+'War')

Fixed code:
i=lambda:map(int,input().split());n,m,x,y=i();print("No "*(max(x,max(i()))<min(min(i()),y))+'War')
Buggy code:
N,M,X,Y=map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))
x.append(X)
y.append(Y)
if max(x)>min(y):
  print('War')
else:
  print('No War')

Fixed code:
N,M,X,Y=map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))
x.append(X)
y.append(Y)
if max(x)>=min(y):
  print('War')
else:
  print('No War')
Buggy code:
n,m,X,Y = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))

x.append(X)
y.append(Y)

if np.max(x) < np.min(y):
    print('No War')
else:
    print('War')

Fixed code:
import numpy as np


n,m,X,Y = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))

x.append(X)
y.append(Y)

if np.max(x) < np.min(y):
    print('No War')
else:
    print('War')
Buggy code:
n, m, xx, yy = map(int, input().split())
x = list(map(int , input().split()))
y = list(map(int , input().split()))
x.sort()
y.sort()

zx = max(x[-1], xx)
zy = min(y[0], yy)

if yy == x[-1]:
    print('War')
    exit()
if xx == y[0]:
    print('War')
    exit()
if x[-1] == y[0]:
    print('War')
    exit()
print('No War')

Fixed code:
n, m, xx, yy = map(int, input().split())
x = list(map(int , input().split()))
y = list(map(int , input().split()))
x.sort()
y.sort()

zx = max(x[-1], xx)
zy = min(y[0], yy)

if yy == x[-1]:
    print('War')
    exit()
if xx == y[0]:
    print('War')
    exit()
if x[-1] == y[0]:
    print('War')
    exit()
if zx > zy:
    print('War')
    exit()

print('No War')
Buggy code:
#ABC-110-B
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

if max(x) > min(y):
    print("War")
else:
    print("No War")

Fixed code:
#ABC-110-B
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x.append(X)
y.append(Y)

if max(x) >= min(y):
    print("War")
else:
    print("No War")
Buggy code:
import sys
def input():
    return sys.stdin.readline()[:-1]
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[-1]<y[0]:
    print("No War")
else:
    print("War")

Fixed code:
import sys
def input():
    return sys.stdin.readline()[:-1]
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[-1]<y[0] and x[-1]<Y and X<y[0]:
    print("No War")
else:
    print("War")