Problem:
 Score : 200 points    Problem Statement Print all the integers that satisfies the following in ascending order:   Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.       Constraints  1 \leq A \leq B \leq 10^9  1 \leq K \leq 100  All values in input are integers.         Input Input is given from Standard Input in the following format:  A  B  K       Output Print all the integers that satisfies the condition above in ascending order.        Sample Input 1 3 8 2      Sample Output 1 3
4
7
8   3 is the first smallest integer among the integers between 3 and 8 .  4 is the second smallest integer among the integers between 3 and 8 .  7 is the second largest integer among the integers between 3 and 8 .  8 is the first largest integer among the integers between 3 and 8 .        Sample Input 2 4 8 3      Sample Output 2 4
5
6
7
8       Sample Input 3 2 9 100      Sample Output 3 2
3
4
5
6
7
8
9

Solution (Python):
A,B,K = map(int, input().split())
ans = set()

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

for a in ans:
    print(a)

Solution (Python):
A,B,K=map(int,input().split())
a=range(A,B+1)
for i in sorted(set(a[:K])|set(a[-K:])):
  print(i)

Solution (Python):
a, b, k = [int(m) for m in input().split(" ")]

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

Solution (Python):
a, b, k = map(int, input().split())
for i in range(a, min(b+1, a+k)):
    print(i)
for i in range(max(b-k+1, a+k), b+1):
    print(i)

Solution (Python):
a,b,k=map(int,input().split())
ans = []
ans.append(a)
for i in range(min(k,b-a)):
    ans.append(a+i)
for j in range(min(k,b-a)):
    ans.append(b-j)
ans.append(b)
for k in range(len(set(ans))):
    print(sorted(set(ans))[k])

Solution (Python):
a,b,k=map(int,input().split())
ans = []
ans.append(a)

for i in range(min(k,b-a)):
    ans.append(a+i)
for j in range(min(k,b-a)):
    ans.append(b-j)
    ans.append(b)
for k in range(len(set(ans))):
    print(sorted(set(ans))[k])

Solution (Python):
a, b, x = map(int, input().split())
s = set()
for i in [j for j in range(a, min(b + 1, a + x))] :
  print(i)
  s.add(i)
for i in [j for j in range(max(a, b - x + 1), b + 1)] :
  if i not in s:
    print(i)

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

if B-A <= K:
  for i in range(A, B+1):
    print(i)
else:
  C = []
  for i in range(A, A+K):
    C.append(i)
  
  D = []  
  for i in range(B, B-K, -1) :
    D.append(i)
    
  E = set(C) | set(D)
  F = sorted(E)
  
  for i in range(len(F)):
      print(F[i])

Solution (Python):
A,B,K = map(int,input().split())
a = []

if B-A<=K:
    for i in range(A,B+1):
        print(i)
else:
    for i in range(A,A+K):
        a.append(i)
    for i in range(B-K+1,B+1):
        a.append(i)
    b =set(a)
    print(' '.join(map(str, sorted(b))))

Solution (Python):

n=[int(i) for i in input().split()]
if(n[1]-n[0]+1<=2*n[2]):
  for i in range(n[0],n[1]+1):
    print(i)
else:
  for j in range(n[0],n[0]+n[2]):
    print(j)
  for k in range(n[1]-n[2]+1,n[1]+1):
    print(k)

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

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

Solution (Python):
a,b,k = input().split()
A = int(a)
B = int(b)
K = int(k)

nums = []
for i in range(K):
	if(A+i <= B):
		nums.append(A+i)
	if(B-i >= A):
		nums.append(B-i)
nums_unique = list(set(nums))
nums_unique.sort()
for j in range(len(nums_unique)):
	print(nums_unique[j])

Solution (Python):


def main():
    a, b, k = list(map(int, input().split()))
    ab_set = set()
    cnt1 = 1
    cnt2 = 1
    
    for i in range(a, b+1):
        if cnt1 <= k:
            ab_set.add(i)
        else:
            break
        cnt1 += 1
        
    for j in range(b, a-1, -1):
        if cnt2 <= k:
            ab_set.add(j)
        else:
            break
        cnt2 += 1
    
    ab_list = list(ab_set)
    ab_list.sort()
    for i in ab_list:
        print(i)


if __name__ == '__main__':
    main()

Solution (Python):
a,b,k = (int(_) for _ in input().split())


l = [i for i in range(a, min(b+1,a+k))] + [i for i in range(b, max(a-1,b-k),-1)]
l = list(set(l))
l.sort()

for i in l:
    print(i)

Solution (Python):
A,B,K=map(int,input().split())
if B-A+1-2*K>=0:
    for i in range(A,A+K):
        print(i)
    for i in range(B-K+1,B+1):
        print(i)
else:
    for i in range(A,B+1):
        print(i)

Solution (Python):
a, b, k = map(int, input().split())
x = []
lx = b-a+1
if k <= lx//2:
    for i in range(a, a+k):
        print(i)
    for i in range(b-k+1, b+1):
        print(i)
else:
    for i in range(a, b+1):
        print(i)

Solution (Python):

from collections import defaultdict 
import sys,heapq,bisect,math,itertools,string

sys.setrecursionlimit(10**8)


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)[::-1]:
		print(B-i)
	
else:
	for i in range(A,B+1):
		print(i)

Solution (Python):

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

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

Solution (Python):
A, B, K = map(int, input().split())
K = min(K,B-A+1)
S = set()
for i in range(K):
    S.add(A + i)
for i in range(K):
    S.add(B - i)
L = sorted(list(S))
for x in L:
    print(x)

Solution (Python):
A, B, K = list(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 i in range(B - K + 1, B + 1):
		print(i)

Solution (Python):
a,b,d = map(int,input().split())

ans=[]

for i in range(d):
    tmp=a+i
    if tmp<b+1:
        ans.append(a+i)

for i in range(d-1,-1,-1):
    if b-i>a-1:
        ans.append(b-i)

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

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

Solution (Python):
A,B,K=list(map(int,input().split()))
numbers=[]
for i in range(K):
    if A+i not in numbers and A+i<=B:
        numbers.append(A+i)
for i in range(K):
    if B-i not in numbers and B-i>=A:
        numbers.append(B-i)
numbers.sort()
for number in numbers:
    print(number)

Solution (Python):
a, b, k = map(int, input().split())
ans = set()
for i in range(a, min(a+k, b+1)):
  ans.add(i)
for i in range(b, max(b-k, a+k-1), -1):
  ans.add(i)
for ele in sorted(ans):
  print(ele)

Solution (Python):
A, B, K = map(int, input().split())
if 2 * K > B - A:
	for x in range(A, B + 1):
		print(x)
else:
	for x in range(A, A + K):
		print(x)
	for x in range(B - K + 1, B + 1):
		print(x)

Solution (Python):
A,B,K=map(int,input().split())
s=set()
for i in range(K):s|={A+i,B-i}
[print(x)for x in sorted(s)if A<=x<=B]

Solution (Python):
A,B,K = map(int,input().split())
s = set()
for i in range(K):
    if A+i > B:
        break
    s.add(A+i)
for i in range(K):
    if B-i < A:
        break
    s.add(B-i)
s = list(s)
s.sort()
for i in s:
    print(i)

Solution (Python):
x = input().split()

a = int(x[0])
b = int(x[1])
k = int(x[2])


if b-a+1 <= k*2:
	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)

Solution (Python):
a,b,k = map(int,input().split())
ans = []
if 2*k <= b-a+1:
    for i in range(k):
        ans.append(a+i)
        ans.append(b-i)
    ans = list(set(ans))
    ans = sorted(ans)
    for i in ans:
        print(i)
else:
    for i in range(a,b+1):
        print(i)

Solution (Python):
def main():
    a, b, k = [int(i) for i in input().split()]

    s = set()
    for i in range(k):
        if a <= a+i and a+i <= b:
            s.add(a+i)
    for i in reversed(range(k)):
        if a <= b-i and b-i <= b:
            s.add(b-i)

    ans = list(s)
    ans.sort()

    for a in ans:
        print(a)
            
if __name__ == '__main__':
    main()

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

ans = set()
temp1 = a
temp2 = b
for i in range(k):
    ans.add(temp1)
    ans.add(temp2)
    temp1 += 1
    temp2 -= 1
    if not(a <= temp1 <= b):
        break

ans_p = sorted(ans)
for val in ans_p:
    print(val)

Solution (Python):
a, b, k = [int(_) for _ in input().split(' ')]
if b + 1 - a < 2 * k:
    for x in range(a, b + 1):
        print(x)
else:
    for x in range(a, a + k):
        print(x)
    for x in range(b + 1 - k ,b + 1):
        print(x)

Solution (Python):
A,B,K = map(int,input().split())
if (B - A + 2)//2 <= K:
    L = list(range(A,B+1))
else:
    L = list(range(A,A+K)) + list(range(B-K+1,B+1))
for i in L:
    print(i)

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

ans=[]

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

Solution (Python):
a,b,k=map(int,raw_input().split())
s=set()
k=min(k,b-a+1)
s.update(range(a,a+k))
s.update(range(b+1-k,b+1))
l = sorted(list(s))
for n in l:
  print n

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

l1 = list(range(A,min(B+1,A+K)))
l2_lower = max(A,(B+1) - K)
l2 = list(range(l2_lower, B+1))
for n in sorted(list(set(l1+l2))):
    print(n)

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

ret = []
for i in range(k):
    if 0<=a+i<=b:
        ret.append(a+i)
    if a<=b-k+1+i<=int(1e9):
        ret.append(b-k+1+i)
        
ret = list(set(ret)) 
ret.sort()
for r in ret:
    print(r)

Solution (Python):
A,B,K = map(int,input().split())
if (B - A + 2)//2 <= K:
    L = list(range(A,B+1))
else:
    L = list(range(A,A+K)) + list(range(B-K+1,B+1))
for i in L:
    print(i)

Solution (Python):
a,b,k=map(int,input().split())
if b+1-a<=2*k:
  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)

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


if B-A <= K:
    for i in range(A,B+1):
        print(i)
else:
    result = set(list(range(A, A+K))+list(range(B,B-K, -1)))

    for i in sorted(list(result)):
        print(i)

Solution (Python):
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')

Solution (Python):
A, B, K = list(map(int, input().split()))
if A+K-1 < B-K+1:
    for i in range(A, A+K):
        print(i)
    for i in range(B-K+1, B+1):
        print(i)
else:
    for i in range(A, B+1):
        print(i)

Solution (Python):
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)

Solution (Python):
a, b, k = map(int, input().split())
xs = list(range(a, min(a+k, b+1)))
ys = list(range(max(a+k, b+1-k), b+1))

print('\n'.join(map(str, xs+ys)))

Solution (Python):
a, b, k = map(int, raw_input().split())
if (b - a + 1)/2 >= k:
	for i in range(a, a + k):
		print i
	for i in range(b - k + 1,b + 1):
		print i
else :
	for i in range(a, b + 1):
		print i

Solution (Python):
A, B, K = map(int, input().split())
    
if B - (A-1) < 2*K:
    l = []
    for i in range(A, B+1):
        l.append(i)
    for j1 in l:
        print(j1)
else:
    for j2 in range(A, A+K):
        print(j2)
    for j3 in range(B-K+1, B+1):
        print(j3)

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

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

Solution (Python):
A, B, K = [int(x) for x in input().split()]

def main():
    ans = []

    a_end = min(A + K, B + 1)
    for i in range(A, a_end):
        ans.append(i)
    
    b_start = max(A, B - K + 1)
    for i in range(b_start, B + 1):
        ans.append(i)
    ans = sorted(set(ans))
    
    for a in ans:
        print(a)

if __name__ == "__main__":
    main()

Solution (Python):
A,B,K = map(int,input().split())
count = A;
for i in range(K):
    if(count <= B):
        print(count)
        count+= 1
count = max(count,B-K+1)
while(count <= B):
    print(count)
    count+=1

Solution (Python):
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)

Solution (Python):
a,b,k = map(int,input().split())
forward = list()

for i in range(a,a+k):
    if i <=b:
        forward.append(i)
    else:
        continue


back = list()
for i in range(b,b-k,-1):
    if b-k >= a:
        back.append(i)
    else:
        continue
        
answer = forward + back

answer = sorted(list(set(answer)))

for num in answer:
    print(num)

Solution (Python):
a, b, k = map(int,input().split())
if (b - a) < 2*k  :
    for i in range(a,b+1):
        print('{}'.format(i))
else:    
    for i in range(k):
        print('{}'.format(a+i))
    for i in range(1,k+1):
        print('{}'.format(b+i-k))

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

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

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

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

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

Solution (Python):
a,b,k = map(int,input().split(' '))
i = 0
ans = ''
if k*2 <= (b - a):
    while i < k:
        ans += str(a+i) + '\n'
        i += 1
    while k > 0:
        ans += str(b-k+1) + '\n'
        k -= 1
else:
    while a <= b:
        ans += str(a) + '\n'
        a += 1
print(ans[:-1])

Solution (Python):
A,B,K = map(int,input().split())
data=[]
for k in range(K):
  data.append(A+k)
  data.append(B-k)
  
data_set = set(data)
data=list(data_set)
data.sort()
for i in data:
  if A<=i<=B:
    print(i)

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

if B - A + 1 <= K * 2:
  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)

Solution (Python):
A,B,K = map(int,input().split())
a = [A+i for i in range(K) if A+i <= B]
b = [B-K+1+i for i in range(K) if B-K+1+i >= A]
a.extend(b)
a = set(a)
a = [x for x in a]
a.sort()
for i in range(len(a)):
  print(a[i])

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

if K > (B - A) / 2:
    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)

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

if B - A + 1 < K * 2:
    for i in range(A,B+1):
        print(i)
else:
    for i in range(A,min(B,A + K)):
        print(i)

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

Solution (Python):



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


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


else:
	for j in range(K):
		print(A+j)
	for k in range(K):
		print(B-K+1+k)

Solution (Python):
A, B, K = map(int, input().split())
ret = set(range(A, min(A + K, B)))
ret.update(range(max(A, B - K + 1), B + 1))

for r in sorted(ret):
    print(r)

Solution (Python):
a,b,k=map(int,input().split());i,c=0,[]
while a+i<b-i and i<k:c+=[a+i];i+=1
i-=i==k
while -~i:c+=[b-i];i-=1
print(*sorted(set(c)),sep='\n')

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

if 2 * K > B - A:
    for i in range(B - A + 1):
        print(A + i)
else:
    for i in range(K):
        print(A + i)
    for j in range(B - K + 1, B + 1):
        print(j)

Solution (Python):
a, b, k = map(int, input().split())
if b - a + 1 <= 2 * k:
    result = ([i for i in range(a, b + 1)])
else:
    result = ([i for i in range(a, a + k)] + [i for i in range(b - k + 1, b + 1)])
for i in result:
    print(i)

Solution (Python):
a, b, k = map(int, input().split())
if k >= -(-(b - a + 1)//2):
    for i in range(a, b + 1):
        print(i)
else:
    for i in range(a, a + k):
        print(i)
    for i in range(b + 1 - k, b + 1):
        print(i)

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

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

Solution (Python):
A,B,K = (int(i) for i in input().split())

if (2*K) >= (B-A+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-i)+1)

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

S=set()
for i in range(k):
    if a+i <= b:
        S.add(a+i)
    if b-i >= a:
        S.add(b-i)
S = [x for x in S]
S.sort()
for i in range(len(S)):
    print(S[i])

Solution (Python):
import numpy as np
a,b,k = map(int,input().split())
data = [i for j in (range(a,min(a+k,b)),range(max(b-k+1,a),b+1)) for i in j]
data = np.unique(data)
for i in data:
    print(i)

Solution (Python):
A,B,K = map(int,input().split())
list_A = list(range(A,min(B+1,A+K)))
list_B = list(range(max(A+K,B-K+1),B+1))
list_C = list_A + list_B
print(*list_C,sep='\n')

Solution (Python):
a,b,c  = map(int,input().split())
li = []
for i in range(c):
    if(a+i <= b-i):
        li.extend([a+i,b-i])
    else:
        break
for i in sorted(set(li)):
    print(i)

Solution (Python):
A,B,K = map(int,input().split())
list_A = list(range(A,min(B,A+K)))
list_B = list(range(max(A,B-K+1),B+1))
list_C = list_A + list_B
set_C = set(list_C)
list_D = sorted(list(set_C))
for i in list_D:
	print(i)

Solution (Python):
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)

Solution (Python):
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):
        print(b-k+i+1)
else:
    for i in range(a, b+1):
        print(i)

Solution (Python):
a, b, k = map(int, input().split())
st = list(range(a, min(b+1, a+k))) + list(range(b, max(a-1, b-k), -1))
for i in sorted(set(st)):
    print(i)

Solution (Python):
a, b, k = map(int, input().split(' '))
if b - a + 1 < 2 * k:
  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)

Solution (Python):
a,b,k = map(int, input().split(" "))
print("\n".join(map(str, sorted(list(set(range(a, b+1)[:k]) | set(range(b, a-1, -1)[:k]))))))

Solution (Python):
A, B, K = map(int, input().split(' '))
if A+K <= B:
    for i in range(A, A+K):
        print(i)
else:
    for i in range(A, B+1):
        print(i)
if B-K+1 <= A+K-1:
    for i in range(A+K, B+1):
        print(i)
else:
    for i in range(B-K+1, B+1):
        print(i)

Solution (Python):
def main():
    a, b, k = map(int, input().split())

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

if __name__ == '__main__':
    main()

Solution (Python):
m,n,x=[int(i) for i in input().split()]
a=set([i for i in range(m,m+x) if i<=n])
b=set([i for i in range(n-x+1,n+1) if i>=m])
for i in sorted(list(a|b)):
  print(i)

Solution (Python):
def abc093b():
    a, b, k = map(int, input().split())
    if b - a + 1 <= 2 * k:
        return [i for i in range(a, b + 1)]
    else:
        return [i for i in range(a, a + k)] + [i for i in range(b - k + 1, b + 1)]


for num in abc093b():
    print(num)

Solution (Python):

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

for i in range(K):
    if A+i <= B:
        print(A+i)

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

Solution (Python):
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

Solution (Python):
def main5():
    str = input("");
    
    buf = str.split();
    num = [];
    for i in range(3):
        num.insert(i,int(buf[i]));
    if num[2] > int((num[1] - num[0])/2):
        for i in range(num[1]-num[0]+1):
            print(num[0] + i,end=' ');
    else:
        for i in range(num[2]):
            print(num[0] + i,end=' ');

        for i in range(num[2]):
            print(num[1] - (num[2]-1) + i,end=' ');

    


if __name__ == '__main__':
    
    main5()

Solution (Python):
A,B,K = map(int,input().split())
ans = []
for i in range(A,A+K):
    if i <= B:
        ans.append(i)
for i in range(B-K+1,B+1):
    if not i in ans and A <= i:
        ans.append(i)
for i in ans:
    print(i)

Solution (Python):
a,b,k = map(int, raw_input().split())
if b - a + 1 > 2 * k:
    for i in range(k):
        print a + i
    for i in range(k,0,-1):
        print b - i + 1
else:
    for i in range(a,b+1):
        print i

Solution (Python):
A, B, K = (int(i) for i in input().split())


if B-A+1 > K*2:
    for i in range(K):
        print(A+i)
    for j in range(K-1, -1, -1):
        print(B-j)
else:
    for i in range(A, B+1):
        print(i)

Solution (Python):
A, B, K = map(int, input().split())
myset  = set()
for i in range(K):
    if(A+i <= B):
        myset.add(A + i)
        myset.add(B - i)
ans = sorted(list(myset))
[print(x) for x in ans]

Solution (Python):
a, b, k = map(int, 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)

Solution (Python):
a,b,c = map(int,input().split())

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

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

for x in range(a, min(a+k, b+1)) :
    print(x)

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

Solution (Python):
A, B, K = map(int, input().split(' '))

if (B - A + 1) < 2 * K:
    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)

Solution (Python):


x = [int(i) for i in input().split()]


a = x[0]
b = x[1]
k = x[2]

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)

Solution (Python):
x = list(map(int,input().split()))
a = x[0]
b = x[1]
k = x[2]
if b - a + 1 < k * 2:
    for i in range(b - a + 1):
        print(a + i)
else:
    for i in range(k):
        print(a + i)
    for i in range(k):
        print(b - k + 1 + i)

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

X = list(range(A, min(A+K, B+1)))
Y = list(range(max(A+K, B-K+1), B+1))
for v in X + Y:
    print(v)

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

res = []

for i in range(a, min(a+k, b+1)):
    res.append(i)

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

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

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

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

Solution (Python):
a, b, k = map(int, raw_input().split())
L1 = [a + i for i in range(k)]
L2 = [b - k + 1 + i for i in range(k)]
in_range = lambda x: a <= x <= b
print "\n".join(map(str, filter(in_range, sorted(set(L1 + L2)))))

Solution (Python):

mondai = input()

mondai = mondai.rstrip().split(" ")
saisyou = int(mondai[0])
saidai = int(mondai[1])
hanni = int(mondai[2])

if saidai - saisyou +1 <=hanni *2:
    for k in range(saidai - saisyou + 1):
        print(k+saisyou)
        k +=1
else:
    i=saisyou
    for i in range(hanni):
        if saisyou+i <= saidai:
            print(saisyou+int(i))
            i +=1
        else:
            i +=1
    j =saidai
    for j in range(hanni):
        if int(saidai) - int(hanni) +j+1>=int(saisyou):
            print(saidai - hanni +j+1)
            j +=1
        else:
            j +=1

Solution (Python):
l = input().split()
a = int(l[0])
b = int(l[1])
k = int(l[2])
ans = set()
for i in range(k):
    n = a + i
    if n <= b and not n in ans:
        ans.add(n)
    n = b - i
    if n >= a and not n in ans:
        ans.add(n)
ans = sorted(list(ans))
ans = [str(a) for a in ans]
for a in ans:
    print(a)

Solution (Python):
a,b,x=list(map(int,input().split()))
if x*2<b-a+1:
    for i in range(x):
        print(a+i)
    for i in range(x):
        print(b-x+1+i)
else:
    for i in range(b-a+1):
        print(i+a)

Solution (Python):
A,B,K=map(int,input().split())
b=min(A+K-1,B)
for i in range(A,b+1):
    print(i)
b2=max(b+1,B-K+1)
for i in range(b2,B+1):
    print(i)

Solution (Python):
a,b,k=map(int,input().split())
if b-a+1<=k*2:
    for i in range(a,b+1):
        print(i)
else:
    for j in range(k):
        print(a+j)
    for kk in range(k):
        print(b-k+kk+1)

Solution (Python):
m = list(map(int, input().split()))
A = m[0]
B = m[1]
K = m[2]

ans = []

for v in range(A, min(A+K, B)):
    ans.append(v)
for v in range(max(B-K+1, A), B+1):
    ans.append(v)

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

Solution (Python):

a, b, k = [int(arg) for arg in input().split()]
if a + k < b + 1 - k:
    for x in range(a, a + k):
        print(x)
    for x in range(b+1-k, b+1):
        print(x)
else:
    for x in range(a, b + 1):
        if x - a < k or b - x < k:
            print(x)

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

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

Solution (Python):
a,b,k=map(int,input().split())
if b-a+1<=2*k:
    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)

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

D = set()
RANGE = A+K if A+K<B else B+1
for i in range(A,RANGE):
    D.add(i)
    
RANGE = B-K+1 if B-K+1>A else A
for i in range(RANGE,B+1):
    D.add(i)
    
for i in sorted(D):
    print(i)

Solution (Python):
a, b, k = map(int, input().split())
aup = min(a+k-1, b)
bdn = max(b-k+1, aup+1)
l1 = list(map(str,range(a, aup+1)))
l2 = list(map(str,range(bdn, b+1)))
print("\n".join(l1 + l2))

Solution (Python):
a, b, k = map(int, input().split())
if b - a < 2 * k:
    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)

Solution (Python):
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)

Solution (Python):
A,B,K = map(int,input().split())
if A+K > B:
    for i in range(A,B+1):
        print(i)
else:
    for i in range(A,A+K):
        print(i)
    if A+K > B-K:
        for i in range(A+K,B+1):
            print(i)
    else:
        for i in range(B-K+1,B+1):
            print(i)

Solution (Python):
A,B,K = map(int,input().split())
for i in range(min(K,B-A+1)):
    print(A+i)
for i in range(max(B-K+1,A+K),B+1):
    print(i)

Solution (Python):
A,B,X = map(int,input().split())
if((B-A)/2 < X):
    for i in range(A,B+1):
        print(i)
else:
    for j in range(A,A+X):
        print(j)
    for k in range(B+1-X,B+1):
        print(k)

Solution (Python):
l = list(map(int,input().split()))
a,b,k = l[0],l[1],l[2]
c = []
for i in range(a,min(a+k,b)):
    c.append(i)
for i in range(max(b-k+1,a),b+1):
    if i not in c:
        c.append(i)
for i in c:
    print(i)

Solution (Python):
A,B,K = map(int,input().split())
if B-A+1 < 2*K:
    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)

Solution (Python):
a, b, k = [int(x) for x in input().split()]
i = a
j = b
arr = []
while i < a + k and i <= j:

    arr.append(i)
    arr.append(j)
    i += 1
    j -= 1
a = list(set(arr))
a.sort()
for i in a:
    print(i)

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

T =[]

for i in range(A,min(A+K,B+1)):
    T.append(i)
for j in range(max(A+K,B-K+1),B+1):
    T.append(j)
S = map(str,sorted(set(T)))
print('\n'.join(S))

Solution (Python):
A, B, K = list(map(int, input().strip().split(' ')))
for j in range(A,min(A+K,B+1)):
    if not(j >= A+K and j <= B-K):
        print(j)
for i in range(max(B-K,j+1),B+1):
    if not(i >= A+K and i <= B-K):
        print(i)

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

if A + K >= B or A >= B - K:
    ans = [i for i in range(A, B+1)]
else:
    ans = [i for i in range(A, A+K)]
    ans.extend([j for j in range(B - K + 1, B+1)])
    ans = sorted(list(set(ans)))
for i in ans:
    print(i)

Solution (Python):
s=list(map(lambda x:int(x), input().split()))
if s[1]-s[0] <= s[2]:
    for k in range(s[0],s[1]+1):
        print(k)
else:
    dst=[s[0]+i for i in range(s[2])]
    dst.extend([s[1]-i for i in range(s[2])])
    dst = sorted(list(set(dst)))
    for k in dst:
        print(k)

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

ans = set()
for i in range(0, K):
    if A + i <= B:
        ans.add(A + i)
    if B - i >= A:
        ans.add(B - i)
ans = list(ans)
ans.sort()
for i in ans:
    print(i)

Solution (Python):
A, B, K = map(int, input().split())
S = set()

for x in range(A, A+K):
	if x > B:
		break
	
	S.add(x)

for x in range(B, B-K, -1):
	if x < A:
		break
	
	S.add(x)

L = list(S)
L.sort()

for x in L:
	print(x)

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

if b - a + 1 <= k * 2:
    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)

Solution (Python):
def main():
    A,B,K = map(int, input().split())

    a = []
    for i in range(A, A+K):
        if i <= B:
            a.append(i)
            print(i)
    for i in range(B-K+1, B+1):
        if ((i in a)==False)and(i>=A):
            print(i)

if __name__ == '__main__':
    main()

Solution (Python):
a,b,c = list(map(int,input().split()))
if a + c-1 < b - c+ 1:
    for i in range(a,a+c):
        print(i)
    for j in range(b-c+1,b+1):
        print(j)
else:
    for i in range(a,b+1):
        print(i)

Solution (Python):
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(k):
        print(a + i)
    for i in range(k):
        print(b - k + 1 + i)

Solution (Python):
l = list(int(i) for i in input().split())

if l[1]-l[0]+1 < 2*l[2]:
    for i in range(l[1]-l[0]+1):
        print("%d" % (i+l[0]))
else:
    for i in range(l[2]):
        print("%d" % (l[0]+i))
    for i in range(l[2]):
        print("%d" % (l[1]-l[2]+1+i))

Solution (Python):
a,b,k = map(int, input().split())
if a + k - 1 < b:
  min_ = a + k - 1
else:
  for i in range(a, b + 1):
    print(i)
  exit(0)
max_ = b - k + 1
if max_ <= min_:
  for i in range(a, b + 1):
    print(i)
  exit(0)
for i in range(a, min_ + 1):
    print(i)

for i in range(max_, b + 1):
    print(i)

Solution (Python):
a, b, k = map(int, input().split())
if b - a - 2*k + 1 > 0:
    for x in (list(range(a, a+k)) + list(range(b-k+1, b+1))):
        print(x)
else:
    for x in (range(a, b+1)):
        print(x)

Solution (Python):
A,B,K = map(int, raw_input().split())
  
for i in range(K):
    if A + i >= A and A + i <= B:
        print(A + i)
for i in range(K):
    if B - K + 1 + i >= A and B - K + 1 + i <= B and B - K + 1 + i > A + K -1:
        print(B - K + 1 + i)