qyliang/CodeNanoFix huggingface dataset:
Buggy code:
A, B, K = map(int, input().split(" "))

if 2 * K <= B - A:
    x = 0
    while x < K:
        print(A + x)
        x += 1
    while x > 0:
        print(B - x)
        x -= 1
    
else:
    x = A
    while x <= B:
        print(x)
        x += 1

Fixed code:
A, B, K = map(int, input().split(" "))

if 2 * K <= B - A:
    x = 0
    while x < K:
        print(A + x)
        x += 1
    x = K
    while x > 0:
        print(B - x + 1)
        x -= 1
    
else:
    x = A
    while x <= B:
        print(x)
        x += 1
Buggy code:
A, B, K = map(int, input().split())
list = [i for i in range(A, A+K)]
list.append(i for i in range(B+1-K, B+1))
list = sorted(set(list))
for i in list: 
    if A<=i<=B:
        print(i)

Fixed code:
A, B, K = map(int, input().split())
list = [i for i in range(A, A+K)]
list.extend(i for i in range(B+1-K, B+1))
list = sorted(set(list))
for i in list:
    if A<=i<=B:
        print(i)
Buggy code:
A, B, K = map(int, input().split())
if K >= B - A + 1:
	for k in range(A, B + 1):
		print(k)
else:
	for i in range(A, A + K):
		print(i)
	for j in range(B - K + 1, B + 1):
		print(j)


Fixed code:
A, B, K = map(int, input().split())
if 2 * K >= B - A + 1:
	for k in range(A, B + 1):
		print(k)
else:
	for i in range(A, A + K):
		print(i)
	for j in range(B - K + 1, B + 1):
		print(j)
Buggy code:
a,b,k = map(int,input().split())

ans = []
for i in range(k):
    if a+i > b:
        break
    ans.append(a+i)
for i in range(k):
    if b-i < a:
        break
    ans.append(b-i)
ans.sort()
ans = set(ans)

for i in ans:
    print(i)

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

ans = []
for i in range(k):
    if a+i > b:
        break
    ans.append(a+i)
for i in range(k):
    if b-i < a:
        break
    ans.append(b-i)

ans = set(ans)
ans =sorted(ans)
for i in ans:
    print(i)
Buggy code:
A, B, K = map(int, input().split())
*p, = range(A, A+K)
*q, = range(B-K+1,B+1)
print(*sorted(set(p+q)), sep='\n')

Fixed code:
A, B, K = map(int, input().split())
*p, = range(A, min(B+1, A+K))
*q, = range(max(A, B-K+1),B+1)
print(*sorted(set(p+q)), sep='\n')
Buggy code:
a,b,k=map(int,(input().split()))
s=[]
for i in range(k):
    if(a+i<=b):
        s.append(a+i)
for i in range(k):
    if(b-(k-i)+1>=a):
        s.append(b-(k-i)+1)

ans=set(s)
for i in ans:
    print(i)

Fixed code:
a,b,k=map(int,(input().split()))
s=[]
for i in range(k):
    if(a+i<=b):
        s.append(a+i)
for i in range(k):
    if(b-(k-i)+1>=a):
        s.append(b-(k-i)+1)
ans=set(s)
tmp=sorted(ans)
for i in tmp:
    print(i)
Buggy code:
A,B,K=map(int,input().split())
ans=[]
for i in range(A,min(A+K,B)):
    ans.append(i)
for i in range(max(A+1,B-K+1),B+1):
    ans.append(i)
ans=set(ans)
for i in ans: print(i)

Fixed code:
A,B,K=map(int,input().split())
ans=[]
for i in range(A,min(A+K,B)):
    ans.append(i)
for i in range(max(A+1,B-K+1),B+1):
    ans.append(i)
if A==B:ans.append(A)
ans=sorted(set(ans))
for i in ans: print(i)
Buggy code:
a,b,k = map(int,input().split())
li = []
if k >= b - a:
    print([x for x in range(a,b+1)])
else:
    for i in range(k):
        li.append(a + i)
    for i in range(k):
        li.append(b - i)
    for i in sorted(li):
        print(i)

Fixed code:
a,b,k = map(int,input().split())
li = []
if 2 * k > b - a:
    for x in range(a,b+1):
        print(x)
else:
    for i in range(k):
        li.append(a + i)
    for i in range(k):
        li.append(b - i)
    for i in sorted(set(li)):
        print(i)
Buggy code:
import math
a,b,k = map(int, input().split())
res = []
if 2*k > b-a:
    k = math.ceil((b-a)/2)
for i in range(k):
    res.append(a+i)
    res.append(b-i)

for s in sorted(set(res)):
    print(s)

Fixed code:
import math
a,b,k = map(int, input().split())
res = []
if 2*k > b-a:
    k = math.ceil((b-a)/2)+1
for i in range(k):
    res.append(a+i)
    res.append(b-i)

for s in sorted(set(res)):
    print(s)
Buggy code:
a, b, k = map(int, input().split())
l = list()
for i in range(a, a + k):
    l.append(i)
for i in range(b - k + 1, b + 1):
    l.append(i)
l = sorted(list(set(l)))
for i in range(len(l)):
    print(l[i])

Fixed code:
a, b, k = map(int, input().split())
l = list()
for i in range(a, a + k):
    if i <= b:
        l.append(i)
for i in range(b - k + 1, b + 1):
    if i >= a:
        l.append(i)
l = sorted(list(set(l)))
for i in range(len(l)):
    print(l[i])
Buggy code:
a,b,k = [int(i) for i in input().split()]
jougen = a+k-1
kagen = b-k+1

if jougen>=kagen:
  for i in range(a,b+1):
    print(i)
    
else:
  for i in range(a,jougen+1):
    print(i)
  for i in range(kagen,b+1)
    

Fixed code:
a,b,k = [int(i) for i in input().split()]
jougen = a+k-1
kagen = b-k+1

if jougen>=kagen:
  for i in range(a,b+1):
    print(i)
    
else:
  for i in range(a,jougen+1):
    print(i)
  for i in range(kagen,b+1):
    print(i)
Buggy code:
a, b, k = map(int, input().split())
if k >= (b - a)//2 :
	for i in range(a, b+1) :
		print(i)   
	exit()
for i in range(a, a + k) :          
	if a <= i < a + k :
		print(i)
for i in range(b - k, b + 1) :
	if b - k < i and a + k <= i:
		print(i)

Fixed code:
a, b, k = map(int, input().split())
if k > (b - a)//2 :
	for i in range(a, b+1) :
		print(i)   
	exit()
for i in range(a, a + k) :          
	if a <= i < a + k :
		print(i)
for i in range(b - k, b + 1) :
	if b - k < i and a + k <= i:
		print(i)
Buggy code:
a,b,k = map(int,input().split())
ans = set([])
for i in range(a,a+k):
    ans.add(i)
for i in range(b-k+1,b+1):
    ans.add(i)
ans = list(ans)
ans.sort()
for i in ans:
    print(i)

Fixed code:
a,b,k = map(int,input().split())
ans = set([])
for i in range(a,min(a+k,b)):
    ans.add(i)
for i in range(max(b-k+1,a),b+1):
    ans.add(i)
ans = list(ans)
ans.sort()
for i in ans:
    print(i)
Buggy code:
a, b, k = map(int, input().split())

ak = [i for i in range(a, a+k)]
bk = [i for i in range(b-k+1, b+1)]

abk = list(set(ak + bk))
abk.sort()

for i in abk:
  print(i)

Fixed code:

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

ak = [i for i in range(a, min(b + 1, a + k))]
bk = [i for i in range(max(a, b - k + 1), b + 1)]

abk = list(set(ak) | set(bk))
abk.sort()

for i in abk:
    print(i)
Buggy code:
A,B,K = map(int,input().split())
ans = []

if(K <= A-B+1):
 for i in range(A,A+K):
   ans.append(i)
 for j in range(B-K+1,B+1):
   ans.append(j)
 ans = set(ans)
 ans = list(ans)
 ans.sort()
 for i in range(len(ans)):
   print(ans[i])
  
else:
  for i in range(A,B+1):
    print(i)

Fixed code:
A,B,K = map(int,input().split())
ans = []

for i in range(A,A+K):
  if(A<= i<= B):
   ans.append(i)
for j in range(B-K+1,B+1):
  if(A<= j<= B):
   ans .append(j)
  
ans = set(ans)
ans = list(ans)
ans.sort()
for i in range(len(ans)):
   print(ans[i])
Buggy code:
def main():
    a, b, k = map(int, input().split())
    
    s = set()

    for i in range(a, a+k-1):
        s.add(i)

    for i in range(b-k+1, b):
        s.add(i)

    for i in s:
        if a <= i and i <= b:
            print(i)

if __name__ == "__main__":
    main()


Fixed code:
def main():
    a, b, k = map(int, input().split())
    
    s = set()

    for i in range(a, a+k):
        s.add(i)

    for i in range(b-k+1, b+1):
        s.add(i)

    for i in sorted(s):
        if a <= i and i <= b:
            print(i)

if __name__ == "__main__":
    main()
Buggy code:
a, b, k = map(int, input().split())
u = set()
for i in range(k):
    u.add(a + i)
    u.add(b - i)

print(*sorted(list(u)), sep='\n')


Fixed code:
a, b, k = map(int, input().split())
u = set()
for i in range(k):
    if a+i <= b:
        u.add(a + i)
    if b-i >= a:
        u.add(b - i)

print(*sorted(list(u)), sep='\n')
Buggy code:
a, b, k = map(int,input().split())

ans = {i for i in range(a,a+k)}
ans2 = {i for i in range(b,b-k,-1)}

ans = ans | ans2
ans = sorted(list(ans))

for an in ans: print(an) 


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

ans = {i for i in range(a,min(a+k,b+1))}
ans2 = {i for i in range(b,max(b-k,a-1),-1)}

ans = ans | ans2
ans = sorted(list(ans))

for an in ans: print(an)
Buggy code:
a, b, k = map(int, input().split())

if 2*k >= b-a:
    for i in range(a, b):
        print(i)
else:
    for i in range(a, a+k):
        print(i)
    for j in range(b-k, b+1):
        print(j)


Fixed code:
a, b, k = map(int, input().split())
if b - a + 1 >= 2 * k:
    for i in range(k):
        print(a + i)
    for i in range(k):
        print(b - k  + 1 + i)
else:
    for i in range(a, b + 1):
        print(i)
Buggy code:
A,B,K=map(int,input().split())
ans=[]

for i in range(K):
    ans.append(A+i)
    ans.append(B-i)
    
l=set(ans)
ans2=list(l)
ans2.sort()

for i in range(len(ans2)):
    print(ans2[i])




Fixed code:
A,B,K=map(int,input().split())
ans=[]

for i in range(K):
    if A+i<=B:
        ans.append(A+i)
    if B-i>=A:
        ans.append(B-i)
    
l=set(ans)
ans2=list(l)
ans2.sort()

for i in range(len(ans2)):
    print(ans2[i])
Buggy code:
a, b, k = map(int, input().split())
match = 2*(b-a)

if k >= match:
    for i in range(a, b):
        print(i)
else:
    for i in range(a, a+k):
        print(i)
    for j in range(b-k, b):
        print(j)

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

if 2*k >= b-a+1:
    for i in range(a, b+1):
        print(i)
else:
    for i in range(a, a+k):
        print(i)
    for j in range(b-k+1, b+1):
        print(j)
Buggy code:
def main():
  A, B, K = [int(x) for x in input().split()]
  for i in range(A, A + K):
    print(i)
  for i in range(max(A + K, B - K + 1), B + 1):
    print(i)


if __name__ == "__main__":
  main()


Fixed code:
def main():
  A, B, K = [int(x) for x in input().split()]
  for i in range(A, min(B + 1, A + K)):
    print(i)
  for i in range(max(A + K, B - K + 1), B + 1):
    print(i)


if __name__ == "__main__":
  main()
Buggy code:
# https://atcoder.jp/contests/abc093/tasks/abc093_b

import itertools
import collections
import bisect

def main():
    A, B, K = map(int, input().split())
    ans = []
    for i in range(K):
        ans.append(A + i)
    for i in range(K):
        ans.append(B - i)

    list(set(ans)).sort()
    for a in ans:
        print(a)


if __name__ == '__main__':
    main()


Fixed code:
# https://atcoder.jp/contests/abc093/tasks/abc093_b

import itertools
import collections
import bisect

def main():
    A, B, K = map(int, input().split())
    ans = []
    for i in range(K):
        if A <= A + i <= B:
            ans.append(A + i)
        else:
            break
    for i in range(K):
        if A <= B - i <= B :
            ans.append(B - i)
        else:
            break

    # print(ans)
    ans = list(set(ans))
    ans.sort()
    for a in ans:
        print(a)


if __name__ == '__main__':
    main()
Buggy code:
a, b, k = map(int, input().split())
ans = []
for i in range(k):
  if a + i <= b:
    ans.append(a + i)
  if b - i >= a:
    ans.append(b - i)
print(ans)  
for i in sorted(set(ans)):
    print(i)

Fixed code:
a, b, k = map(int, input().split())
ans = []
for i in range(k):
  if a + i <= b:
    ans.append(a + i)
  if b - i >= a:
    ans.append(b - i) 
for i in sorted(set(ans)):
    print(i)
Buggy code:
a,b,k = list(map(int,input().split()))

a_l = [a+i for i in range(k+1)]
b_l = [b-i for i in range(k+1)]
if b-a < k:
    [print(i) for i in range(a,b+1)]
else:
    [print(i) for i in set(a_l+b_l)]


Fixed code:
a,b,k = list(map(int,input().split()))

a_l = [a+i for i in range(k)]
b_l = [b-i for i in range(k)]
if b-a < k:
    [print(i) for i in range(a,b+1)]
else:
    [print(i) for i in sorted(set(a_l+b_l))]
Buggy code:
A, B, K = map(int,input().split())
for i in range(A, min(A + K, B + 1)):
  if i < A + K or i > B - K: print(i) 
for i in range(max(A,B - K,A + K - 1), B):
  if i < A + K or i > B - K: print(i + 1)    

Fixed code:
A, B, K = map(int,input().split())
for i in range(A, min(A + K, B + 1)):
  print(i) 
for i in range(max(B - K, A) , B):
  if i + 1 >= A + K: print(i + 1)
Buggy code:
A,B,K=map(int,input().split())
X=[i for i in range(A,A+K)]+[j for j in range(B-K+1,B+1)]
X=sorted(list(set(X)))
for x in X:print(x)

Fixed code:
A,B,K=map(int,input().split())
X=[i for i in range(A,min(B,A+K))]+[j for j in range(max(A,B-K+1),B+1)]
X=sorted(list(set(X)))
for x in X:print(x)
Buggy code:
A, B, K = map(int, input().split())
ans = []
for i in range(A,A+K):
    if B <= i:
        break
    ans.append(i)
for i in range(B-K+1,B+1):
    if i <= A:
        continue
    ans.append(i)
ans.sort()
ans2 = set(ans)
for i in ans2:
    print(i)

Fixed code:
A, B, K = map(int, input().split())
ans = []
if A == B:
    print(A)
    exit()
for i in range(A,A+K):
    if B <= i:
        break
    ans.append(i)
for i in range(B-K+1,B+1):
    if i <= A:
        continue
    ans.append(i)
ans2 = set(ans)
ans3 = list(ans2)
ans3.sort()
for i in ans3:
    print(i)
Buggy code:
a,b,k=map(int,input().split())
la=list(range(a,a+k))
lb=list(range(b,b-k,-1))
for i in sorted(set(la+lb)):
  print(i)

Fixed code:
a, b, k = map(int, input().split())
la = list(range(a, a+k))
lb = list(range(b-k+1, b+1))
set = sorted(set(la+lb))

for i in set:
    if a <= i <= b:
        print(i)
Buggy code:
A,B,K = map(int,input().split())
S=set()
for i in range(K):
  S.add(A+i)
  S.add(B-i)
print("\n".join(str(x) for x in sorted(list(S))))

Fixed code:
A,B,K = map(int,input().split())
S=set()
for i in range(K):
  S.add(A+i)
  S.add(B-i)
print("\n".join(str(x) for x in sorted(list(S)) if A <= x <= B))
Buggy code:
A, B, K = map(int, input().split())

nums = []
for num in range(A, min(A+K, B+1)):
  nums.append(num)
for num in range(min(B-K+1, a), B+1):
  if not num in nums:
    nums.append(num)
nums.sort()
for num in nums:
  print(num)

Fixed code:
A, B, K = map(int, input().split())

nums = []
for num in range(A, min(A+K, B+1)):
  nums.append(num)
for num in range(max(B-K+1, A), B+1):
  if not num in nums:
    nums.append(num)
nums.sort()
for num in nums:
  print(num)
Buggy code:
import sys
import math

a,b,k = list(map(int, input().split()))
lis = list(range(a,a+k))
lis.extend(list(range(b-k+1, b+1)))
lis = list(set(lis))
lis.sort()
for i in range(len(lis)):
    print(lis[i])

Fixed code:
import sys
import math

a,b,k = list(map(int, input().split()))
if b-a+1 <= k:
    for i in range(a,b+1):
        print(i)
else:
    lis = list(range(a,a+k))
    lis.extend(list(range(b-k+1, b+1)))
    lis = list(set(lis))
    lis.sort()
    for i in range(len(lis)):
        print(lis[i])
Buggy code:
a, b, k = map(int, input().split())

l = list(range(a, b + 1))
ans = []
ans.extend(l[:min(b,k)])
ans.extend(l[max(len(l) - k,a):])

ans = list(set(ans))
ans = sorted(ans)
for a in ans:
   print(a)

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

for i in range(a, min(b, a + k - 1) + 1):
    print(i)
for i in range(max(a + k, b - k + 1), b + 1):
    print(i)

exit()
l = list(range(a, b + 1))
ans = []
ans.extend(l[:min(k,len(l))])
ans.extend(l[max(0,len(l) - k):])

ans = sorted(list(set(ans)))
for a in ans:
   print(a)
Buggy code:
A, B, K = map(int, input().split())
ans = list(set(range(A, A+K)) | set(range(B-K, B)))
ans.sort()
for i in ans:
	if A <= i <= B:
		print(i)

Fixed code:
A, B, K = map(int, input().split())
ans = list(set(range(A, A+K)) | set(range(B-K+1, B+1)))
ans.sort()
for i in ans:
	if A <= i <= B:
		print(i)
Buggy code:
A,B,K = map(int, input().split())
X = []
L = B-A+1
if 2*K>=L:
    for i in range(L):
        print(A+i)
else:
    for j in range(K):
        print(A+i)
    for k in range(K):
        print(A-K+k)

Fixed code:
A,B,K = map(int, input().split())
X = []
L = B-A+1
if 2*K>=L:
    for i in range(L):
        print(A+i)
else:
    for j in range(K):
        print(A+j)
    for k in range(K):
        print(B-K+1+k)
Buggy code:

A, B, K = map(int, input().split())

if A+K-1 >= B-K+1:
    for i in range(A, B+1):
        print(i)

else:
    for i in range(A, A+K-1):
        print(i)
    for i in range(B-K+1, B):
        print(i)

Fixed code:
A, B, K = map(int, input().split())

if A+K-1 >= B-K+1:
    for i in range(A, B+1):
        print(i)

else:
    for i in range(A, A+K):
        print(i)
    for i in range(B-K+1, B+1):
        print(i)
Buggy code:
a, b, k = map(int,input().split())
for i in range(1, min(a + k + 1, b + 1)):
  print(i)
for i in range(max(b - k, a + k + 1, b + 1)):
  print(i)
  

Fixed code:
a, b, k = map(int,input().split())
for i in range(a, min(a + k, b + 1)):
  print(i)
for i in range(max(b - k + 1, a + k), b + 1):
  print(i)
Buggy code:
a, b, k = map(int, input().split())
X = []
for i in range(a, min(a+k, b)):
    X.append(i)

for j in range(max(b-k+1, a+1), b+1):
    X.append(j)

X_s = set(X)
for k in X_s:
    print(k)

Fixed code:
a, b, k = map(int, input().split())
X = []
for i in range(a, min(a+k, b+1)):
    X.append(i)

for j in range(max(b-k+1, a), b+1):
    X.append(j)
X = sorted(X)
X_s = sorted(set(X), key=X.index)
for k in X_s:
    print(k)
Buggy code:
A,B,K =map(int,input().split())

L = []
for i in range(K):
    x = A+i
    y = B-i
    if x not in L:
        L.append(x)
    if y not in L:
        L.append(y)
L.sort()

for x in L:
    print(x)

Fixed code:
A,B,K =map(int,input().split())

L = []
for i in range(K):
    x = A+i
    y = B-i
    if x not in L and x >= A and x <= B:
        L.append(x)
    if y not in L and x >= A and x <= B:
        L.append(y)
L.sort()

for x in L:
    print(x)
Buggy code:
A, B, K = map(int, input().split())
ans = []
for i in range(A,min(B+1,A+K+1),1):
    if i not in ans:
        ans.append(i)
for j in range(B,max(A-1,B-K-1),-1):
    if j not in ans:
        ans.append(j)
ans = sorted(ans)
for k in ans:
    print(k)


Fixed code:
A, B, K = map(int, input().split())
ans = []
for i in range(A,min(B+1,A+K),1):
    if i not in ans:
        ans.append(i)
for j in range(B,max(A-1,B-K),-1):
    if j not in ans:
        ans.append(j)
ans = sorted(ans)
for k in ans:
    print(k)
Buggy code:
a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(k,b)+1):
  ans.append(i)
for i in range(max(b-k,a),b+1):
  ans.append(i)
ans = list(set(ans))
for i in ans:
  print(i)

Fixed code:
a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b+1)):
  ans.append(i)
for i in range(max(b-k+1,a),b+1):
  ans.append(i)
ans = sorted(list(set(ans)))
for i in ans:
  print(i)
Buggy code:
a, b, k = map(int ,input().split())

ans = []
for i in range(k):
    print(a+i)
    ans.append(a+i)
for i in range(-k+1,1):
    if i not in ans:
        print(b+i)

Fixed code:
a, b, k = map(int ,input().split())
if b-a+1 <= k:
    k = b-a+1
ans = []
for i in range(k):
    print(a+i)
    ans.append(a+i)
for i in range(-k+1,1):
    if b+i not in ans:
        print(b+i)
Buggy code:

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

for i in range(a, a + k):
    if i > b:
        break
    print(i)
for i in range(max(a + k, b - k), b + 1):
    if i > b:
        break
    print(i)

Fixed code:

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

for i in range(a, a + k):
    if i > b:
        break
    print(i)
for i in range(max(a + k, b - k + 1), b + 1):
    if i > b:
        break
    print(i)
Buggy code:
a, b, k = map(int, input().split())

ans = set()

for i in range(k):
    ans.add(a + i)
    ans.add(b - i)

ans = list(ans)
ans.sort()

for ele in ans:
    print(ele)


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

ans = set()

for i in range(k):
    ans.add(min(a + i, b))
    ans.add(max(b - i, a))

ans = list(ans)
ans.sort()

for ele in ans:
    print(ele)
Buggy code:
a,b,k=map(int,input().split())
if b-a+1>=2*k:
    for i in range(k):
        print(i)
    for i in range(k):
        print(b-k+1+i)
else:
    for i in range(a,b+1):
        print(i)

Fixed code:
a,b,k=map(int,input().split())
if a+k-1>=b-k+1:
  for i in range(a,b+1):
    print(i)
else:
  for i in range(k):
    print(a+i)
  for i in range(k):
    print(b-k+1+i)
Buggy code:
a,b,k = map(int,input().split())

if b-a < k:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,b+1)[:k]:
        print(i)
    
    for i in range(a,b+1)[-k:]:
        print(i)
    

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

if b-a < k*2:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,b+1)[:k]:
        print(i)
    
    for i in range(a,b+1)[-k:]:
        print(i)
Buggy code:
a, b, k = map(int, input().split())
a_upper = min(b, a+k)
b_lower = max(a, b-k)
u = set(range(a, a_upper+1))
v = set(range(b_lower, b+1))
for i in sorted(list(u|v)):
  print(i)

Fixed code:
a, b, k = map(int, input().split())
a_upper = min(b, a+k-1)
b_lower = max(a, b-k+1)
u = set(range(a, a_upper+1))
v = set(range(b_lower, b+1))
for i in sorted(list(u|v)):
  print(i)
Buggy code:
a, b, k = map(int, input().split())

nums = set()
for i in range(k):
    #print(a)
    nums.add(a)
    a += 1
    if a > b:
        break
for j in range(k):
    #print(b)
    nums.add(b)
    b -= 1
    if a > b:
        break

for k in nums:
    print(k)


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

nums = set()
for i in range(k):
    #print(a)
    nums.add(a)
    a += 1
    if a > b:
        break
for j in range(k):
    #print(b)
    nums.add(b)
    b -= 1
    if a > b:
        break

nums = sorted(nums)
for k in nums:
    print(k)
Buggy code:
a, b, k = [int(x) for x in input().split()]

wk1 = list(range(a, min(a+k, b)))
wk2 = list(range(max(b-k+1, a), b+1))

for c in (wk1 + wk2):
    print(c)

Fixed code:
a, b, k = [int(x) for x in input().split()]

wk1 = list(range(a, min(a+k, b)))
wk2 = list(range(max(b-k+1, a), b+1))

for c in sorted(set(wk1 + wk2)):
    print(c)
Buggy code:
a,b,k = map(int,input().split())
lia,lib = [],[]

for i in range(a,min(a+k,b)):
    lia.append(i)
for i in range(max(a,b-k+1),b+1):
    lib.append(i)

lia.extend(lib)
for i in set(lia):
    print(i)

Fixed code:
a,b,k = map(int,input().split())
lia,lib = [],[]

for i in range(a,min(a+k,b)):
    lia.append(i)
for i in range(max(a,b-k+1),b+1):
    lib.append(i)

lia = list(set(lia+lib))
lia.sort()
for i in lia:
    print(i)
Buggy code:
s = input().split()
s = list(map(int,s))
ans = []

i = 0
while i<s[2]:
   if (i+s[0])>s[1]:
      i += 1
   elif (i+s[0])<=s[1]:
      ans.append(int(i + s[0]))
      i += 1

i = 0
while  i<s[2]:
   if (s[1]-i)>=s[0]:
       ans.append(int(s[1]-i))
       i += 1
   elif (s[1]-i)<s[0]:
       i += 1

ans = list(set(ans))

for a in ans:
   print(a)

Fixed code:
s = input().split()
s = list(map(int,s))
ans = []

i = 0
while i<s[2]:
   if (i+s[0])>s[1]:
      i += 1
   elif (i+s[0])<=s[1]:
      ans.append(int(i + s[0]))
      i += 1

i = 0
while  i<s[2]:
   if (s[1]-i)>=s[0]:
       ans.append(int(s[1]-i))
       i += 1
   elif (s[1]-i)<s[0]:
       i += 1

ans = list(set(ans))
ans.sort()

for a in ans:
   print(a)
Buggy code:
A,B,K=map(int,input().split())
C=[]
D=[]
for i in range(K):
    C.append(A+i)
for i in range(K):
    D.append(B-i)
E=C+D
E.sort()
F=list(set(E))
for i in range(len(F)):
    print(F[i])

Fixed code:
A,B,K=map(int,input().split())
C=[]
D=[]
for i in range(K):
    if A+i<=B:
        C.append(A+i)
for i in range(K):
    if B-i>=A:
        D.append(B-i)
E=C+D
E.sort()
F=list(set(E))
F.sort()
for i in range(len(F)):
    print(F[i])
Buggy code:
a, b, k = map(int,input().split())
if (b-a) /2  > k:
    for i in range(k):
        print(a+i)
    for i in range(k+1):
        print(b-k+i)
else:
    for i in range(a,b+1):
        print(i)


Fixed code:
a,b,k=map(int,input().split())
if a+k-1>=b-k+1:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)
Buggy code:
import math
a , b , k = map(int , input().split())
ans = set()
for i in range(min(k , math.ceil((b - a) / 2))):
  ans.add(a + i)
  ans.add(b - i)
ans = sorted(list(ans))
print('\n'.join([str(n) for n in ans]))

Fixed code:
import math
a , b , k = map(int , input().split())
ans = set()
for i in range(min(k , math.ceil((b - a + 1) / 2))):
  ans.add(a + i)
  ans.add(b - i)
ans = sorted(list(ans))
print('\n'.join([str(n) for n in ans]))
Buggy code:
A, B, K = map(int, input().split())
for x in range(A, A+K):
  if x<=B: print(x)

for x in range(B-K+1, B+1):
  if x>=A: print(x)


Fixed code:
A, B, K = map(int, input().split())
for x in range(A, A+K):
  if x<=B: print(x)

for x in range(max(x+1, B-K+1), B+1):
  if x>=A: print(x)