qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if b - a <= k and c - b <= k and d - c <= k and e - d <= k and c - a <= k and d - a <= k and e - a <= k and d - b <= k and e - b <= k and e - c <= k:
    print("Yay!")
else:
    print(": (")


Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if b - a <= k and c - a <= k and d - a <= k and e - a <= k and c-b <= k and d-b <= k and e-b <= k and d-c <= k and e-c <= k and e - d <= k:
    print("Yay!")
else:
    print(":(")
Buggy code:
A=[int(input()) for _ in range(5)]
k=int(input())

if max(A)-min(A)>k:
	print(":(")
else:
	print("Yay!

Fixed code:
A=[int(input()) for _ in range(5)]
k=int(input())

if (max(A)-min(A))>k:
	print(":(")
else:
	print("Yay!")
Buggy code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if mac(a,b,c,d,e)-min(a,b,c,d,e)<=k:
    print("Yay!")
else:
    print(":(")


Fixed code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if max(a,b,c,d,e)-min(a,b,c,d,e)<=k:
    print("Yay!")
else:
    print(":(")
Buggy code:
usrInput = {}
for n in range(6):
  append.usrInput = input()

for l in range(5):
  for m in range(5):
    if abs(int(usrInput[l])-int(usrInput[m])) > usrInput[6]:
      flag = True

if flag:
  print(":(")
else:
  print("Yay!")

Fixed code:
usrInput = []
flag = False
for n in range(6):
    usrInput.append(int(input()))

for l in range(5):
    for m in range(5):
        if abs(int(usrInput[l]) - int(usrInput[m])) > usrInput[5]:
            flag = True

if flag:
    print(":(")
else:
    print("Yay!")
Buggy code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

a = [int(input()) for i in range(5)]
k = int(input())

d = a[4] - a[0]
print(':)' if d > k else 'Yay!')


Fixed code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

a = [int(input()) for i in range(5)]
k = int(input())

d = a[4] - a[0]
print(':(' if d > k else 'Yay!')
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e - a <= k :
    print("Yey!")
else :
    print(":(")


Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e - a <= k :
    print("Yay!")
else :
    print(":(")
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if k < e-d or k < d-c or k < c-b or b-a:
    print(":(")
else:
    print("Yay!")

Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if k < abs(e-a):
    print(":(")
else:
    print("Yay!")
Buggy code:
# coding: utf-8
a,b,c,d,e,k=map(int,input())
if e-a>k:
  print(':(')
else:
  print('Yay!')

Fixed code:
# coding: utf-8
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a>k:
  print(':(')
else:
  print('Yay!')
Buggy code:
list = [a,b,c,d,e]
flag = 0

for first_num in list:
    for second_num in list:
        if (first_num - second_num) > abs(k):
          flag = 1
 
if flag == 0:
  print('Yay!')  
else:
  print(':(')
   

Fixed code:
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()


list = [a,b,c,d,e]
flag = 0


for first_num in list:
    for second_num in list:
        if (int(first_num) - int(second_num)) > abs(int(k)):
          flag = 1

if flag == 0:
  print('Yay!')
else:
  print(':(')
Buggy code:
xs = []
for x in range(5):
   xs.append(int(input()))
k = int(input())
if max(xs) - min(xs) > k:
    print(":(")
else:
    print("Yay")


Fixed code:
xs = []
for x in range(5):
   xs.append(int(input()))
k = int(input())
if max(xs) - min(xs) > k:
    print(":(")
else:
    print("Yay!")
Buggy code:
a,b,c,d,e,k=map(int,input())
if e-a>k:
  print(':(')
else:
  print('Yay!')

Fixed code:
a = int(input())
b = input()
c = input()
d = input()
e = int(input())
k = int(input())

if e - a > k:
  print(':(')
else:
  print('Yay!')
Buggy code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
l=[a,b,c,d,e]
if max(l)-min(l)>k:
    print(':(')
else:
    print('Yay!!')

Fixed code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
l=[a,b,c,d,e]
if max(l)-min(l)>k:
    print(':(')
else:
    print('Yay!')
Buggy code:
crd = []
a = int(input())
crd.append(a)
b = int(input())
crd.append(b)
c = int(input())
crd.append(c)
d = int(input())
crd.append(d)
e = int(input())
crd.append(e)
k = int(input())

print(len(crd))
for x in range(len(crd)):
    for y in range(x+1, len(crd)-x):
        print(x, y)
        print(crd[int(x)], crd[int(y)])
        z = k - (crd[y] - crd[x])
        print("z= ", z)
        if z < 0:
            print(":(")
            break
    else:
        continue
    break
else:
    print("Yay!")





Fixed code:
crd = []
a = int(input())
crd.append(a)
b = int(input())
crd.append(b)
c = int(input())
crd.append(c)
d = int(input())
crd.append(d)
e = int(input())
crd.append(e)
k = int(input())

#print(len(crd))
for x in range(len(crd)):
    for y in range(x+1, len(crd)-x):
        #print(x, y)
        #print(crd[int(x)], crd[int(y)])
        z = k - (crd[y] - crd[x])
        #print("z= ", z)
        if z < 0:
            print(":(")
            break
    else:
        continue
    break
else:
    print("Yay!")
Buggy code:
a=input()
b=input()
c=input()
d=input()
e=input()
k=input()
f=min(a,b,c,d,e)
g=max(a,b,c,d,e)
h=g-f
if h <= k:
  print('Yay')
else:
  print(':(')

Fixed code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
f=min(a,b,c,d,e)
g=max(a,b,c,d,e)
h=g-f
if h <= k:
  print('Yay!')
else:
  print(':(')
Buggy code:
antena = []
for _ in range(5):
    antena.append(int(input()))
    
k = int(input())

if k >= antena[-1]-antena[1]:
    print("Yay!")
else:
    print(":(")

Fixed code:
antena = []
for _ in range(5):
    antena.append(int(input()))
    
k = int(input())

if k >= antena[-1]-antena[0]:
    print("Yay!")
else:
    print(":(")
Buggy code:
l = []
for _ in range(5):
    l.append(int(input()))

k = int(input())

ans = []
for i in range(5):
    for j in range(5):
        ans.append(abs(l[i] - l[j])>k) 

print([':(','Yay!'][all(ans)])

Fixed code:
l = []
for _ in range(5):
    l.append(int(input()))

k = int(input())

ans = []
for i in range(5):
    for j in range(5):
        ans.append(abs(l[i] - l[j])>k) 

print(['Yay!',':('][any(ans)])
Buggy code:
l = [int(input()) for i in range(6)]
if l[4] - l[0] =< l[5]:
    print("Yay!")
else:
    print(":(")

Fixed code:
t = [int(input()) for i in range(6)] 

if t[4] - t[0] <= t[5]:
  print('Yay!')
else:
  print(':(')
Buggy code:
import sys
a=[int(i) for i in sys.stdin.resd().split('\n')]
k=a[5]
a=a[:5][::-1]
def check(a,k):
  for i in range(len(a[:4])):
    for j in range(i,len(a)):
      if a[i]-a[j]>k:
        return False
  return True
if check(a,k):
  print('Yay!')
else:
  print(':(')

Fixed code:
import sys

d = [int(i) for i in sys.stdin.read().split('\n') if i != '']
k = d[5]
d = d[:5][::-1]


def check(k, d):
    for i in range(len(d[:4])):
        for j in range(i, len(d)):
            if d[i] - d[j] > k:
                return False
    return True


if check(k, d):
    print('Yay!')
else:
    print(':(')
Buggy code:
l = [input() for i in range(6)]
if l[4] - l[0] < l[5]:
    print("Yay!")
else:
    print(":(")

Fixed code:
l = [int(input()) for i in range(6)]
if l[4] - l[0] <= l[5]:
    print("Yay!")
else:
    print(":(")
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if b-a <= k and c-b <= k and d-c <= k and e-d <= k:
    print("Yay!")
else:
    print(":(")

Fixed code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if k<e-a:
    print(':(')
else:
    print('Yay!')
Buggy code:
a=[int(input()) for i in range(5)]
k=int(input())
for i in range(4):
    for j in range(i+1,5):
        if abs(a[i]-a[j])>k:
            print(":)")
            exit()
print("Yay!")

Fixed code:
a=[int(input()) for i in range(5)]
k=int(input())
for i in range(4):
    for j in range(i+1,5):
        if a[j]-a[i]>k:
            print(":(")
            exit()
print("Yay!")
Buggy code:
li=[]

for i in range(5):
    li.append(int(input()))

k=int(input())

li.sort()
print(li)

if li[-1]-li[0]>k:
    print(":(")
else:
    print("Yay!")


Fixed code:
li=[]

for i in range(5):
    li.append(int(input()))

k=int(input())

li.sort()


if li[-1]-li[0]>k:
    print(":(")
else:
    print("Yay!")
Buggy code:

line=[]

for i in range(5):
    line.append( int(input()))

k = int(input())



out = "Yay!"

for i in range(5):
    for j in range(4-i):
        tmp = line[i] - line[j+1]
        print(tmp)

        if abs(tmp) > k:
            out = ":("

    if out == ":(":
        break

print(out)

Fixed code:

line=[]

for i in range(5):
    line.append( int(input()))

k = int(input())

out = "Yay!"

for i in range(5):
    for j in range(4-i):
        tmp = line[i] - line[j+1]

        if abs(tmp) > k:
            out = ":("

    if out == ":(":
        break

print(out)
Buggy code:
a,b,c,d,e,k = map(int,open(0).read().split())
if max(b-a,c-b,d-c,e-d) <= k:
    print(":(")
else:
    print("Yay!")


Fixed code:
a,b,c,d,e,k = map(int,open(0).read().split())
if e-a <= k:
    print("Yay!")
else:
    print(":(")
Buggy code:
a, b, c, d, e, k = [int(input()) for i in range(6)]

if b-a > k:
    print (':(')
    if c-b > k:
        print (':(')
        if d-c > k:
            print (':(')
            if e-d > k:
                print (':(')
else:
    print ('Yay!')

Fixed code:
a, b, c, d, e, k = [int(input()) for i in range(6)]

if e-a > k:
    print (':(')
else:
    print ('Yay!')
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())


lis = [e,d,c,b,a]
lis2 = [a,b,c,d,e]

yay_flg = 0

for x in lis:
  for j in lis2:
    if x == j:
      break
    
    if x - j <= k:
      yay_flg = 1
      
if yay_flg == 1:
  print("Yay!")
  
else:
  print(":(")


Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())


lis = [e,d,c,b,a]
lis2 = [a,b,c,d,e]

yay_flg = 0
exist_flg = 0

for x in lis:
  for j in lis2:
    if x == j:
      break
      
    if x - j <= k:
      yay_flg = 1
      
    if x - j > k:
      exist_flg = 1
      
if yay_flg == 1 and exist_flg == 0:
  print("Yay!")
  
else:
  print(":(")
Buggy code:
#A
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

ant = [a,b,c,d,e]
flg = True
for i in range(5):
    for j in range(i,5):
        if i != j:
            dist = abs(ant[i]-ant[j])
            if dist > k:
                flg = False
                break
if flg:
    print('Yey!')
else:
    print(':(')

Fixed code:
#A
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

ant = [a,b,c,d,e]
flg = True
for i in range(5):
    for j in range(5):
        if i != j:
            #print(dist)
            dist = abs(ant[i]-ant[j])
            if dist > k:
                flg = False
                break
if flg:
    print('Yay!')
else:
    print(':(')
Buggy code:
lists=[]
for i n range(5):
  nums=int(input())
  lists.append(nums)
dis=int(input())
lists=sorted(lists)
if lists[-1]-lists[0]<=dis:
  print("Yay!")
else:
  print(":(")

Fixed code:
lists=[]
for i in range(5):
  nums=int(input())
  lists.append(nums)
dis=int(input())
lists=sorted(lists)
if lists[-1]-lists[0]<=dis:
  print("Yay!")
else:
  print(":(")
Buggy code:
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
dis = e - a
if dis <= k:
    print('Yay!')
else:
    print(':(')

Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
dis = e - a
if dis <= k:
    print('Yay!')
else:
    print(':(')
Buggy code:
l=[]
for i in range(5):
    l.append(i)
k=int(input())

if max(l)-min(l) > k:
    print(':(')
else:
    print('Yay!')



Fixed code:
l=[]
for i in range(5):
	l.append(int(input()))

k=int(input())

if max(l)-min(l) > k:
    
    print(':(')
else:
    print('Yay!')
Buggy code:
antenna = []
for i in range(5):
  antenna.append(int(input()))
k = int(input())
if k < max(antenna) - min(antenna):
  print("Yay!")
else:
  print(":(")

Fixed code:
antenna = []
for i in range(5):
  antenna.append(int(input()))
k = int(input())
if k >= max(antenna) - min(antenna):
  print("Yay!")
else:
  print(":(")
Buggy code:
a=[int(input()) for i in range(5)]
k=int(input())
s=0
for i in range(5):
    for k in range(5):
        n=a[k]-a[i]
        if n>k:
            s+=1
if s!=0:
    print("+(")
else:
    print("Yay!")

Fixed code:
a=[int(input()) for i in range(5)]
m=int(input())
s=0
for i in range(5):
    for k in range(5):
        n=a[k]-a[i]
        if n>m:
            s+=1
if s!=0:
    print(":(")
else:
    print("Yay!")
Buggy code:
a = [int(input()) for _ in range(5)]
k = int(input())
for i in range(4):
  if a[i+1] - a[i] > k
    print(":(")
    exit()
print("Yay!")

Fixed code:
a = [int(input()) for _ in range(5)]
k = int(input())
for i in range(4):
  if a[i+1] - a[0] > k:
    print(":(")
    exit()
print("Yay!")
Buggy code:
# -*- coding: utf-8 -*-

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if (e - a) < k:
    print(":(")
else:
    print("Yay!")



Fixed code:
# -*- coding: utf-8 -*-

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if (e - a) > k:
    print(":(")
else:
    print("Yay!")
Buggy code:
a = [0] * 5
c = 0
for i in range(5):
  a.append(int(input()))
k = int(input())
for i in range(5):
  for j in range(5):
    if a[i] - a[j] > k:
      c = 1
if c:
  print(":(")
else:
  print("Yay!")

Fixed code:
a = []
c = 0
for i in range(5):
  a.append(int(input()))
#print(a)
k = int(input())
#print(k)
for i in range(5):
  for j in range(5):
    if abs(a[i] - a[j]) > k:
      #print(abs(a[i] - a[j]))
      c = 1
if c == 1:
  print(":(")
else:
  print("Yay!")
Buggy code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if b-a>k:
  print(':(')
  exit()
if c-b>k:
  print(':(')
  exit()
if d-c>k:
  print(':(')
  exit()
if e-d>k:
  print(':(')
  exit()
print('Yay!')

Fixed code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a > k:print(":(")
else:print("Yay!")
Buggy code:
a,b,c,d,e,k=[int(input()) for i in range(5)]
print(e-a if e-a<=k else ":(")

Fixed code:
a,b,c,d,e = [int(input()) for i in range(5)]
k = int(input())
if e-a<=k:
    print('Yay!')
else:
    print(':(')
Buggy code:
anntena  = [int(input()) for i in range(5)]
k = int(input())

distance = []
for i in range(4):
    distance.append(anntena[i + 1] - anntena[i])
    
tmp = [i for i in distance if not i  >= 0 ]
if len(tmp) == 0:
    print("Yay!")
else:
    print(":(")

Fixed code:
anntena  = [int(input()) for i in range(5)]
k = int(input())

distance = []
for i in range(4):
    for j in range(i + 1, 5):
        distance.append(anntena[j] - anntena[i])
    
tmp = [i for i in distance if i  > k ]
if len(tmp) == 0:
    print("Yay!")
else:
    print(":(")
Buggy code:
import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
def ddprint(x):
  if DBG:
    print(x)

a = inn()
b = inn()
c = inn()
d = inn()
e = inn()
k = inn()
print(':(' if e-a > k else 'Yay')


Fixed code:
import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
def ddprint(x):
  if DBG:
    print(x)

a = inn()
b = inn()
c = inn()
d = inn()
e = inn()
k = inn()
print(':(' if e-a > k else 'Yay!')
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if abs(a-e) > k:
    print(":(")
else:
    print("Yey!")

Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if abs(a-e) > k:
    print(":(")
else:
    print("Yay!")
Buggy code:
List = [int(input()) for i in range(5)]
k = int(input())
ans = 0

List = sorted(List)
for i in range(4):
  if List[i+1] - List[i] > k:
    ans = 1

print(":(" if ans == 1 else "Yay!")

Fixed code:
List = [int(input()) for i in range(5)]
k = int(input())
ans = 0

List = sorted(List)

print(":(" if List[4] - List[0] > k else "Yay!")
Buggy code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

if b-a and c-b and d-c and e-d <= k:
    print("Yay!")
else:
    print(":(")

Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

r = e - a

if r <= k:
    print("Yay!")
else:
    print(":(")
Buggy code:
a = int(intpu())
b= int(intpu())
c = int(intpu())
d = int(intpu())
e = int(intpu())
k = int(intpu())

if e - a > k:
    print(':(')
else:
    print('Yay!')


Fixed code:
a = int(input())
b= int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a > k:
    print(':(')
else:
    print('Yay!')
Buggy code:
a = 0
b = 0
c = 0
d = 0
e = 0
k = 0
x = 0
y = 0

antena = [a, b, c, d, e]



for i in range(5):

    for j in range(i+1, 5):
        result = antena[j] - antena[i]
        

        if result > k:
            x += 1


        else:
            y += 1


if x == 10 and y == 0:
    print(":(")

elif y >= 1:
    print("Yay!")


Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
x = 0
y = 0

antena = [a, b, c, d, e]



for i in range(5):

    for j in range(i+1, 5):
        result = antena[j] - antena[i]
        

        if result > k:
            x += 1


        else:
            y += 1
            


if x >= 1 and y < 10:
    print(":(")

elif x == 0 and y == 10:
    print("Yay!")
Buggy code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if b-a<k & c-a<k & d-a<k & e-a<k & c-b<k & d-b<k & e-b<k & d-c<k & e-c<k & e-d<k:
  print("Yay!")
else:
  print(":(")
  

Fixed code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

if e-a<=k and e-b<=k and e-c<=k and e-d<=k:
    print("Yay!")
else:
    print(":(")
Buggy code:
A = [input() for i in range(6)]
X = map(int, A)
a = X[0]
e = X[4]
k = X[5]
if e-a > k:
    print(":(")
else:
    print("Yay!")

Fixed code:
A = [input() for i in range(6)]
X = list(map(int, A))
a = X[0]
e = X[4]
k = X[5]
if e-a > k:
    print(":(")
else:
    print("Yay!")
Buggy code:
a,b,c,d,e,k=[int(input()) for _ in range(6)]
if a-e>k:
    print(':(')
else:
    print('Yay!')

Fixed code:
a,b,c,d,e,k=[int(input()) for _ in range(6)]
if e-a>k:
    print(':(')
else:
    print('Yay!')
Buggy code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

if e - d > k:
  print(':(')
elif d - c > k:
   print(':(')
elif c - b > k: 
  print(':(')
elif b - a > k:
  print(':(')
else:
  print('Yay!')

Fixed code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
 
if e - a > k:
  print(':(')
else:
  print('Yay!')
Buggy code:
antennas=[]
for _ in range(5):
    antennas.append(int(input()))
k=int(input())
    
for i in range(5):
    for j in range(i+1,5):
        if antennas[j]-antennas[i]>k:
            print(":()")
            exit()

print("Yay!")
                    

Fixed code:
antennas=[]
for _ in range(5):
    antennas.append(int(input()))
k=int(input())
    
for i in range(5):
    for j in range(i+1,5):
        if antennas[j]-antennas[i]>k:
            print(":(")
            exit()

print("Yay!")
Buggy code:
i = [int(input()) for i in range(6)]

if (max(i[1:6])-min(i[1:6])) <= i[5]:
  print('Yay!')
else:
  print(":(")

Fixed code:
i = [int(input()) for i in range(6)]

if (max(i[0:5])-min(i[0:5])) <= i[5]:
  print('Yay!')
else:
  print(":(")
Buggy code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
l = max(b - a, c - b, d - c, e - d)
if l < k:
  print("Yay!")
else:
  print(":(")

Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if max(a, b, c, d, e) - min(a, b, c, d, e) <= k:
  print('Yay!')
else:
  print(':(')
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())


k = int(input())

def diff(x, y, z = k):
  if abs(x - y) > z:
    return 1
  else:
    return 0
  
num = 0

num += diff(a, e)
num += diff(a, d)
num += diff(a, c)
num += diff(a, b) 
num += diff(b, e)
num += diff(b, d)
num += diff(b, c)
num += diff(c, e)
num += diff(c, d)
num += diff(d, e)

if num > 0:
  print("Yay!")
else:
  print(":(")

Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())


k = int(input())

def diff(x, y, z = k):
  if abs(x - y) > z:
    return 1
  else:
    return 0
  
num = 0

num += diff(a, e)
num += diff(a, d)
num += diff(a, c)
num += diff(a, b) 
num += diff(b, e)
num += diff(b, d)
num += diff(b, c)
num += diff(c, e)
num += diff(c, d)
num += diff(d, e)

if num == 0:
  print("Yay!")
else:
  print(":(")
Buggy code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if (e - a <= f):
    print("Yay!")
else:
    print(":(")

Fixed code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
print("Yay!") if e-a<=k else print(":(")
Buggy code:
data = [int(input()) for i in range(5)]
k = int(input())
flag = True
for i in range(len(data)-1):
    for j in range(i, len(data)):
        if data[j]-data[i] > k:
            flag = False

if flag:
    print("Yay")
else:
    print(":(")

Fixed code:
data = [int(input()) for i in range(5)]
k = int(input())
flag = True
for i in range(len(data)-1):
    for j in range(i, len(data)):
        if data[j]-data[i] > k:
            flag = False

if flag:
    print("Yay!")
else:
    print(":(")
Buggy code:
l = [int(input()) for _ in range(5)]
k = int(input())
 
flag = False
for i in range(5):
  for j in range(i +1, 5):
    if l[j] - l[i] > k:
      flag = True
      break

if flag:
  print(":(")
else:
  print("Yay")

Fixed code:
l = [int(input()) for _ in range(5)]
k = int(input())
 
flag = False
for i in range(5):
  for j in range(i +1, 5):
    if l[j] - l[i] > k:
      flag = True
      break
 
if flag:
  print(":(")
else:
  print("Yay!")
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if b-a <= k and c-b <= k and d-c <= k and e-d <= k:
    print('Yay!')
else:
    print(':(')



Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if abs(e -a ) <= k:
    print("Yay!")
else:
    print(":(")
Buggy code:
import sys


def main():
    h = [int(input()) for count in range(6)]
    k = h[5]
    for i in range(len(h) - 2):
        if abs(h[i] - h[i + 1]) > k:
            print(":(")
            sys.exit()
    print("Yay!")


if __name__ == '__main__':
    main()


Fixed code:
import sys


def main():
    h = [int(input()) for count in range(6)]
    k = h[5]
    for i in range(len(h) - 1):
        for j in range(len(h) - 1):
            if abs(h[i] - h[j]) > k:
                print(":(")
                sys.exit()
    print("Yay!")


if __name__ == '__main__':
    main()
Buggy code:
S = [int(input()) for _ in range(5)]
k=int(input())
a=max(S)
b=min(S)
if a-b>k:
    print(':(') 
    exit()       
else:
    print('Yey!')

Fixed code:
S = [int(input()) for _ in range(5)]
k=int(input())
a=max(S)
b=min(S)
if a-b>k:
    print(':(') 
    exit()       
else:
    print('Yay!')