qyliang/CodeNanoFix huggingface dataset:
Buggy code:
S=list(input())
N=len(S)
S_int=list(S)
for i in range(N):
    S_int[i]=int(S[i])
cnt_1=0
cnt_2=0
for i in range(N):
    if i%2==0 and S_int[i]==0:
        S_int[i]=1
        cnt_1+=1
    elif i%2==1 and S_int[i]==1:
        S_int[i]=0
        cnt_1+=1
for i in range(N):
    if i%2==0 and S_int[i]==1:
        S_int[i]=0
        cnt_2+=1
    elif i%2==1 and S_int[i]==0:
        S_int[i]=1
        cnt_2+=1
print(min(cnt_1,cnt_2))

Fixed code:
S=list(input())
N=len(S)
S_int_1=list(S)
S_int_2=list(S)
for i in range(N):
    S_int_1[i]=int(S[i])
    S_int_2[i]=int(S[i])
cnt_1=0
cnt_2=0
for i in range(N):
    if i%2==0 and S_int_1[i]==0:
        S_int_1[i]=1
        cnt_1+=1
    elif i%2==1 and S_int_1[i]==1:
        S_int_1[i]=0
        cnt_1+=1
for i in range(N):
    if i%2==0 and S_int_2[i]==1:
        S_int_2[i]=0
        cnt_2+=1
    elif i%2==1 and S_int_2[i]==0:
        S_int_2[i]=1
        cnt_2+=1
print(min(cnt_1,cnt_2))
Buggy code:
a = list(str(input()))
counter = 0
if len(a) == 1:
    counter = 0
else:
    for i in range(1,len(a)):
        if a[i] == a[i-1]:
            counter += 1
        else:
            pass
print(counter)  

Fixed code:
a = list(str(input()))
counter = 0
if len(a) == 1:
    counter = 0
else:
    for i in range(1,len(a)):
        if a[i] == a[i-1]:
            if a[i-1] == '0':
                a[i] = '1'
            else:
                a[i] = '0'     
            counter = counter + 1
print(counter)
Buggy code:
import sys

input = sys.stdin.readline


def main():
    s = input()
    length = len(s)
    o = "10" * (length // 2 + (length % 2))
    o_len = len([i for i, j in zip(s, o) if i == j])
    z_len = len([i for i, j in zip(s, o[::-1]) if i == j])
    print(length - max([z_len, o_len]))


if __name__ == "__main__":
    main()


Fixed code:
import sys

input = sys.stdin.readline


def main():
    s = input().strip()
    length = len(s)
    o = "10" * (length // 2 + (length % 2))
    o_len = len([i for i, j in zip(s, o) if i == j])
    z_len = len([i for i, j in zip(s, o[::-1]) if i == j])
    print(length - max([z_len, o_len]))


if __name__ == "__main__":
    main()
Buggy code:
import numpy as np

s_ = int(input())
s = np.array(list(map(int, str(s_))))

a01 = np.tile([0,1], len(s)//2+1)
a10 = np.tile([1,0], len(s)//2+1)

if len(s)%2 != 0:
    a01 = np.delete(a01, len(s))
    a10 = np.delete(a10, len(s))
else:
    a01 = np.delete(a01, [len(s)-1,len(s)])
    a10 = np.delete(a10, [len(s)-1,len(s)])

ans01 = np.abs(s -a01)
ans10 = np.abs(s -a10)

if sum(ans01) >= sum(ans10):
    print(sum(ans10))
else:
    print(sum(ans01))

Fixed code:
import numpy as np

s = np.array(list(map(int, input())))

a01 = np.tile([0,1], len(s)//2+1)
a10 = np.tile([1,0], len(s)//2+1)

if len(s)%2 != 0:
    a01 = np.delete(a01, len(s))
    a10 = np.delete(a10, len(s))
else:
    a01 = np.delete(a01, [len(s)-1,len(s)])
    a10 = np.delete(a10, [len(s)-1,len(s)])

ans01 = np.abs(s -a01)
ans10 = np.abs(s -a10)

if sum(ans01) >= sum(ans10):
    print(sum(ans10))
else:
    print(sum(ans01))
Buggy code:
n=input()
cnt=0
for i in range(len(n)):
    if n[0]=="0":
        if i%2==0 and n[i]=="1" :
            cnt+=1
        if i&2==1 and n[i]=="0" :
            cnt+=1
    else:
        if i%2==0 and n[i]=="0" :
            cnt+=1
        if i%2==1 and n[i]=="1" :
            cnt+=1
print(cnt)

Fixed code:
n=input()
cnt=0
for i in range(len(n)):
    if n[0]=="0":
        if i%2==0 and n[i]=="1" :
            cnt+=1
        if i%2==1 and n[i]=="0" :
            cnt+=1
    else:
        if i%2==0 and n[i]=="0" :
            cnt+=1
        if i%2==1 and n[i]=="1" :
            cnt+=1
print(cnt)
Buggy code:
s = input()
n = len(s)
white_start = 0
black_start = 0
for i in range(n):
    if s[i] == '0' and i%2 == 0:
        black_start += 1
    else:
        white_start += 1
print(min(black_start,white_start))

Fixed code:
s = input()
n = len(s)
white_start = 0
black_start = 0
for i in range(n):
    if s[i] == '0' and i%2 == 0:
        black_start += 1
    elif s[i] == '0' and i%2 == 1:
        white_start += 1
    elif s[i] == '1' and i%2 == 0:
        white_start += 1
    else:
        black_start += 1
print(min(black_start,white_start))
Buggy code:
s = list(map(int,input()))
 
n = len(s)

ans = 0
for i in range(n-1):
  if s[i] == s[i+1]:
    ans += 1
    if s[i] == 0:
      s[i+1] = 1
    else:
      s[i] = 0
    
 
print(ans)

Fixed code:
s = list(map(int,input()))

n = len(s)
 
ans_l = 0
for i in range(n-1):
  if s[i] == s[i+1]:
    ans_l += 1
    if s[i] == 0:
      s[i+1] = 1
    else:
      s[i+1] = 0
print(ans_l)
Buggy code:
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    S = input()
    S_ = S[::-1]
    N = len(S)
    count = 0
    count_ = 0
    for i in range(N):
        if i % 2 == 0:
            if S[i] == '0':
                count += 1
            if S_[i] == '0':
                count_ += 1
        if i % 2 == 1:
            if S[i] == '1':
                count += 1
            if S_[i] == '1':
                count_ += 1
    if count < count_:
        print(count)
    else:
        print(count_)

if __name__ == '__main__':
    main()


Fixed code:
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    S = input()
    N = len(S)
    count = 0
    count_ = 0
    for i in range(N):
        if i % 2 == 0:
            if S[i] == '0':
                count += 1
            else:
                count_ += 1
        else:
            if S[i] == '1':
                count += 1
            else:
                count_ += 1
    if count < count_:
        print(N - count_)
    else:
        print(N - count)

if __name__ == '__main__':
    main()
Buggy code:
S = str(input())
li = list(S)

i=0
c=0
count=0

while len(li) > i :
    if int(li[i]) == c :
        count = count + 1
    c = c + 1
    c = c % 2
    i = i + 1
    
if len(li) / 2 + 1 > count : 
    ans = len(li) - count
else :
    ans = count

print(ans)

Fixed code:
S = str(input())
li = list(S)

i=0
c=0
count=0

while len(li) > i :
    if int(li[i]) == c :
        count = count + 1
    c = c + 1
    c = c % 2
    i = i + 1
    
if len(li) / 2 < count : 
    ans = len(li) - count
else :
    ans = count

print(ans)
Buggy code:
def subtract_lst (lst1, lst2, ans):
    for i in range(len(lst1)):
        e1 = lst1[i]
        e2 = lst2[i]
        if e1 != e2:
            ans += 1
    return ans

if __name__ == '__main__':
    s = input()
    a = ""
    b = ""
    for i in range(len(s) // 2):
      a = a + "10"
      b = b + "01"
    if lenS % 2 == 1:
        a = a + "1"
        b = b + "0"
    print (min(subtract_lst (a, s, 0), subtract_lst (b, s, 0)))


Fixed code:
def subtract_lst (lst1, lst2):
    ans = 0
    for i in range(len(lst1)):
        e1 = lst1[i]
        e2 = lst2[i]
        if e1 != e2:
            ans += 1
    return ans

if __name__ == '__main__':
    s = input()
    lenS = len(s)
    a = ""
    b = ""
    for i in range(lenS // 2):
      a = a + "10"
      b = b + "01"
    if lenS % 2 == 1:
        a = a + "1"
        b = b + "0"
    aAns = subtract_lst (a, s)
    bAns = subtract_lst (b, s)
    print (min(aAns, bAns))
Buggy code:
s = input()

n = len(s)
p = s[::2].count("1") + s[1::2].count("0")

ans = min(n-p, n)
print(ans)


Fixed code:
s = input()

n = len(s)
p = s[::2].count("1") + s[1::2].count("0")

ans = min(p, n-p)
print(ans)
Buggy code:
#https://atcoder.jp/contests/abc124
# -*- coding: utf-8 -*-

s = list(input())

cnt1=0
for i in range(len(s)):
        if s[i] is i%2:
                count1 += 1

cnt2=0
for i in range(len(s)):
        if s[i] is (i+1)%2:
                count1 += 1

print(min(cnt1,cnt2))

Fixed code:
#https://atcoder.jp/contests/abc124
# -*- coding: utf-8 -*-

s = list(input())
cnt1=0
for i in range(len(s)):
        if int(s[i]) == i%2:
                cnt1 += 1

cnt2=0
for i in range(len(s)):
        if int(s[i]) == (i+1)%2:
                cnt2 += 1

print(min(cnt1,cnt2))
Buggy code:
from sys import stdin
import math
import itertools


def makeIntMatrix(lines):
    intMatrix = []
    for a in makeStringMatrix(lines):
        intMatrix.append([int(b) for b in a])
    return intMatrix
 
 
def makeStringMatrix(lines):
    stringMatrix = [line.split() for line in lines]
    return stringMatrix
 
 
def makeInt(line):
    return int(line.rstrip())
 
 
def makeMultiInteger(line):
    return [int(x) for x in line.rstrip().split()]


def solve(input_string):
    s = list(input_string[0][:])
    c = 0
    for i in range(len(s))[1:]:
        print(i)
        if s[i] == s[i-1]:
            if s[i] == "1":
                s[i] = "0"
            else:
                s[i] = "1"
            c += 1
    return c



def main():
    input_lines = stdin.readlines()
    answer = solve(input_lines)
    print(answer)


if __name__ == '__main__':
    main()


Fixed code:
from sys import stdin
import math
import itertools


def makeIntMatrix(lines):
    intMatrix = []
    for a in makeStringMatrix(lines):
        intMatrix.append([int(b) for b in a])
    return intMatrix
 
 
def makeStringMatrix(lines):
    stringMatrix = [line.split() for line in lines]
    return stringMatrix
 
 
def makeInt(line):
    return int(line.rstrip())
 
 
def makeMultiInteger(line):
    return [int(x) for x in line.rstrip().split()]


def solve(input_string):
    s = list(input_string[0][:])
    c_1 = 0
    for i in range(len(s))[1:]:
        if s[i] == s[i-1]:
            if s[i] == "1":
                s[i] = "0"
            else:
                s[i] = "1"
            c_1 += 1
    c_2 = 0
    for i in range(len(s))[::-1][1:]:
        if s[i] == s[i+1]:
            if s[i] == "1":
                s[i] = "0"
            else:
                s[i] = "1"
            c_2 += 1
    return c_2 if c_2 > c_1 else c_1



def main():
    input_lines = stdin.readlines()
    answer = solve(input_lines)
    print(answer)


if __name__ == '__main__':
    main()
Buggy code:
S=[input().split()]
N=len(S)
ans1=0
ans2=0
for i in range(N): #101010...
    if i%2==0 and S[i]!=1:
        ans1+=1
    if i%2==1 and S[i]!=0:
        ans1+=1
for i in range(N): #01010...
    if i%2==0 and S[i]!=0:
        ans2+=1
    if i%2==1 and S[i]!=1:
        ans2+=1
print(min(ans1,ans2))

Fixed code:
S=list(input())
N=len(S)
ans1=0
ans2=0
for i in range(N): #101010...
    if i%2==0 and S[i]!='1':
        ans1+=1
    if i%2==1 and S[i]!='0':
        ans1+=1
for i in range(N): #01010...
    if i%2==0 and S[i]!='0':
        ans2+=1
    if i%2==1 and S[i]!='1':
        ans2+=1
print(min(ans1,ans2))
Buggy code:
a =list(input())


def saisyo1(a):
    kisuu = a[1::2]
    guusuu = a[0::2]
    count = 0
    for i in kisuu:
        if i != 1:
            count += 1
    for i in guusuu:
        if i != 0:
            count += 1
    return count

def saisyo0(a):
    kisuu = a[1::2]
    guusuu = a[0::2]
    count = 0
    for i in kisuu:
        if i != 0:
            count += 1
    for i in guusuu:
        if i != 1:
            count += 1
    return count

def main():
   print(min(saisyo0(a),saisyo1(a)))

if __name__ == '__main__':
    main()


Fixed code:
a =list(input())


def saisyo1(a):
    kisuu = a[1::2]
    guusuu = a[0::2]
    count = 0
    for i in kisuu:
        if i != "1":
            count += 1
    for i in guusuu:
        if i != "0":
            count += 1
    return count

def saisyo0(a):
    kisuu = a[1::2]
    guusuu = a[0::2]
    count = 0
    for i in kisuu:
        if i != "0":
            count += 1
    for i in guusuu:
        if i != "1":
            count += 1
    return count

def main():
    print(min(saisyo0(a),saisyo1(a)))


if __name__ == '__main__':
    main()
Buggy code:
s=input()
c1=c2=0
f1='0'
f2='1'
for x in s:
  if f1==x:
    pass
  else:
    c1+=1
  if f1=='0':
    f1='1'
  else:
    f1='0'
for x in s:
  if f2==x:
    pass
  else:
    c2+=1
  if f2=='0':
    f2='1'
  else:
    f2='0'
print(c1,c2)
print(min(c1,c2))

Fixed code:
s=input()
c1=c2=0
f1='0'
f2='1'
for x in s:
  if f1==x:
    pass
  else:
    c1+=1
  if f1=='0':
    f1='1'
  else:
    f1='0'
for x in s:
  if f2==x:
    pass
  else:
    c2+=1
  if f2=='0':
    f2='1'
  else:
    f2='0'
print(min(c1,c2))
Buggy code:
s = []
for i in range(5):
    s.apppend(int(input()))
k = int(input())
for i in range(4):
    if s[i+1]-s[i] >k:
        print(":(")
        break
else:
    print("Yay!")

Fixed code:
s = []
for i in range(5):
    s.append(int(input()))
k = int(input())
for i in range(4):
    if s[i+1]-s[0] >k:
        print(":(")
        break
else:
    print("Yay!")
Buggy code:
A=[int(input()) for _ in range(5)]
print("Yay!" if (A[-1]-A[0])>int(input()) else ":(")

Fixed code:
A=[int(input()) for _ in range(5)]
print("Yay!" if (A[-1]-A[0])<=int(input()) else ":(")
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e-d <= k and d-c <= k and c-b <= k and b-a <= 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:
  print("Yay!")
else:
  print(":(")
Buggy code:
List = []
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
k = int(input())

CW = []
for i in range(len(List)):
    for j in range(i+1,len(List)):
        if List[j]-List[i] <= k:
            CW.append(True)

if all(CW):
    print("Yay!")
else:
    print(":(")

Fixed code:
List = []
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
k = int(input())

CW = []
for i in range(len(List)):
    for j in range(i+1,len(List)):
        if List[j]-List[i] <= k:
            CW.append(True)
        else:
            CW.append(False)

if all(CW):
    print("Yay!")
else:
    print(":(")
Buggy code:
x = [int(input()) for i in range(5)]
if x[4] - x[0] < x[-1]: print("Yay!")
else: print(":(")

Fixed code:
x = [int(input()) for i in range(6)]
if x[4] - x[0] <= x[-1]: 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<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 e-d > k or d-c > k or c-b > k or 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:
`a=[0]*5
for i in range(5):
    a[i]=int(input().strip())
k=int(input().strip())
d=max(a)-min(a)
if d<=k:
    print("Yay!")
else:
    print(":(")

Fixed code:
a=[0]*5
for i in range(5):
    a[i]=int(input().strip())
k=int(input().strip())
d=max(a)-min(a)
if d<=k:
    print("Yay!")
else:
    print(":(")
Buggy code:
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
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,b,c,d,e=int(input()),int(input()),int(input()),int(input()),int(input())
k=int(input())
print("yay!"if e-a<=k else":(")

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

spot = max(b-a,c-b,d-c,e-d)
if spot <= 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())

spot = e-a
if spot <= k:
    print("Yay!")
else:
    print(":(")
Buggy code:
antenna = [int(input()) for _ in range(N)]
k = int(input())

print("Yay!" if max(antenna) - min(antenna) <= k else ":(")

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

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

flag=True
for i in range(5):
  temp_posi_list = posi_list.copy()
  posi = temp_posi_list[i]
  del temp_posi_list[i]
  temp_posi_list = np.array(temp_posi_list)
  max_dist = max(np.abs(temp_posi_list - posi))
  if max_dist > k:
    flag=False
    break
if flag:
  print("Yay!")
else:
  print(":(")

Fixed code:
import numpy as np

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

flag=True
for i in range(5):
  temp_posi_list = posi_list.copy()
  posi = temp_posi_list[i]
  del temp_posi_list[i]
  temp_posi_list = np.array(temp_posi_list)
  max_dist = max(np.abs(temp_posi_list - posi))
  if max_dist > k:
    flag=False
    break
if flag:
  print("Yay!")
else:
  print(":(")
Buggy code:
inpl = []
inpl.append(int(input()))
inpl.append(int(input()))
inpl.append(int(input()))
inpl.append(int(input()))
inpl.append(int(input()))
d = int(input())
print(':(' if d > max(inpl) - min(inpl) else 'Yay!')

Fixed code:
inpl = []
inpl.append(int(input()))
inpl.append(int(input()))
inpl.append(int(input()))
inpl.append(int(input()))
inpl.append(int(input()))
d = int(input())
print(':(' if d < (max(inpl) - min(inpl)) else 'Yay!')
Buggy code:
data_ls = []
for i in range(5):
  data_ls.append(int(input()))
k = int(input())
sort(data_ls)
if data_ls[-1] - data_ls[0] > k:
  print("Yay!")
else:
  print(":(")

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

Fixed code:
a,b,c,d,e,k=[int(input()) for i in range(6)]
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 b - a <= k:
    if c - b <= k:
        if d - c <= k:
            if e - d <= k:
                print("Yay!")
            else:
                print(":(")
        else:
            print(":(")
    else:
        print(":(")
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(":(")
else:
    print("Yay!")
Buggy code:
lis = []
for i in range(5):
    lis.append(int(input()))

K = int(input())

for i in range(5):
    for j in range(i, 5):
        if lis[j]-lis[i] > K:
            print(":)")
            exit()

print("Yay!")


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

K = int(input())

for i in range(5):
    for j in range(i, 5):
        if lis[j]-lis[i] > K:
            print(":(")
            exit()

print("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(":(")
else:
  print("Yai!")

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 = [input() for x in range(5)]
k = int(input())

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



Fixed code:
a = [int(input()) for x in range(5)]
k = int(input())
 
if a[4] - a[0] > k:
  print(':(')
else:
  print('Yay!')
Buggy code:
antenas = list(int, input() for i in range(5))

k = int(input)

if (antenas[4] - antenas[0]) <= k:
  print("Yay!")
else :
  print(":(")
  
  


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

k = int(input())

if (antenas[4] - antenas[0]) <= 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 (a-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 (e-a) <= k:
    print('Yay!')
else:
    print(':(')
Buggy code:
A = []
for i in range(6):
    A.append(int(input()))
st = 4 
s = 'Yay!'
for i in range(4): 
    for j in range(st):
        print(A[st-i], A[st-1-j], A[5])
        if A[st-i] - A[st-1-j] > A[5]:
            s = ':('
    if s == ':(':
        break
print(s)


Fixed code:
A = []
for i in range(6):
    A.append(int(input()))
st = 4 
s = 'Yay!'
for i in range(4): 
    for j in range(st):
        if A[st] - A[st-1-j] > A[5]:
            s = ':('
    if s == ':(':
        break
    st -= 1
print(s)
Buggy code:
a = []
for i in range(5):
    a.append(int(input()))
k = int(input())

ans = "Yay!"

for i in range(5):
    for j in range(5):
        if abs(a[i]-a[j]) > k:
            ans = "(:"

print(ans)



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

ans = "Yay!"

for i in range(5):
    for j in range(5):
        if abs(a[i]-a[j]) > k:
            ans = ":("

print(ans)
Buggy code:
n=[int(input()) for _ in range(6)];print([':(','Yay'][max(n[:5])-min(n[:5])<=n[5]])

Fixed code:
n=[int(input()) for _ in range(6)];print([':(','Yay!'][max(n[:5])-min(n[:5])<=n[5]])
Buggy code:
l = [0] * 5
for i in range(5):
  l[i] = int(input())
k = int(input())

for i in range(5):
  for j in range(5):
    if abs(i - j) > k:
      print(':(')
      exit()
print('Yay!')

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

#print(l, k)

for i in range(5):
  for j in range(5):
    if abs(l[i] - l[j]) > k:
      print(':(')
      exit()

print('Yay!')
Buggy code:
a = [int(input()) for i in range(6)]
print("Yay!" if a[4]-a[0]>a[5] else ":(")

Fixed code:
a = [int(input()) for i in range(6)]
print("Yay!" if a[4]-a[0]<=a[5] else ":(")
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if (b-a) > k or (c-b) > k or (d-c) > k or (e-d) > 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 (b-a) > k or (c-a) > k or (d-a) > k or (e-a) > k or (c-b) > k or (d-b) > k or (e-b) > k or (d-c) > k or (e-c) > k or (e-d) > k:
  print(':(')
else:
  print('Yay!')
Buggy code:
a = [int(input()) for _ in range(5)]
k = int(input())
for i in range(len(a)):
  for j in range(i+1,len(a)):
    print(a[i],a[j])
    if abs(a[i]-a[j])>k:
      print(":(")
      quit()
print("Yay!")

Fixed code:
a = [int(input()) for _ in range(5)]
k = int(input())
for i in range(len(a)):
  for j in range(i+1,len(a)):
    if abs(a[i]-a[j])>k:
      print(":(")
      quit()
print("Yay!")
Buggy code:
a=list(map(int, [input() for i in range(6)]))
if(a[4]-a[0])>a[5]:
    print(':(')
else:
    print('Yey!')

Fixed code:
a=list(map(int, [input() for i in range(6)]))
if(a[4]-a[0])>a[5]:
    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-a =< 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:
  print("Yay!")
else:
  print(":(")