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):



import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

A, B, K = map(int, input().split())
s = set()
for v in range(A, min(B + 1, A + K)):
    s.add(v)
for v in range(max(A, B - K + 1), B + 1):
    s.add(v)
for v in sorted(s):
    print(v)

Solution (Python):
a = list(map(int,input().split()))
A = a[0]
B = a[1]
K = a[2]
for i in range(K):
    num = A+i
    if num <= B:
        print(str(num))
for i in range(K):
    num = B - K + i + 1
    if num < A+K:
        pass
    else:
        print(str(num))

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

l = set(list(range(a, b+1)[:k]) + list(range(a, b+1)[-k:]))
l = sorted(list(l))

for n in l:
    print(n)

Solution (Python):
A,B,K=map(int,input().split(' '))
l = [A+i for i in range(K) if A+i<=B] + [B-i for i in range(K) if B-i>=A]
for s in sorted(list(set(l))):
  print(s)

Solution (Python):
A,B,K=map(int,input().split())
s1={i for i in range(A,A+K if A+K<B else B)}
s2={i for i in range(B-K+1 if A<B-K+1 else A,B+1)}
s=s1|s2
for i in sorted(list(s)):
    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())
lr = A+K-1
rl = B-K+1
if lr >= rl:
    for i in range(A,B+1): print(i)
else:
    for i in range(A,lr+1): print(i)
    for i in range(rl,B+1): print(i)

Solution (Python):
a,b,k=map(int,input().split())
l = range(a, b + 1) if b - a + 1 <= k else sorted(set(range(a, a + k)) | set(range(b - k + 1, b + 1)))
for i in l: 
  print(i)

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

C = A + K - 1
D = B - K + 1

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

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

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

for i in sorted(set(select)):
    print(i)

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

Solution (Python):
a, b, k = map(int, input().split())
arr = []
for i in range(k):
    if int((b - a) / 2 + 0.5) >= i:
        arr.append(a + i)
        arr.append(b - i)
    else:
        break
arr = list(set(arr))
arr.sort()
for i in arr:
    print(i)

Solution (Python):
a,b,k=map(int,input().split());r=range(a,b+1);print(*sorted(set(r[:k])|set(r[-k:])))

Solution (Python):

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

if a+k <= b-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 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 = (int(i) for i in input().split())

len_ab = b-a+1

if (len_ab+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())
if(b-a<300):
  for i in range(b-a+1):
    if(a+i<=a+(k-1)):
      print(a+i)
    elif(a+i>=b-(k-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):
def small_and_large_integers(A: int, B: int, K: int) -> list:
    l, r = [], []
    for k in range(K):
        if A + k == B - k:
            l = l + [A+k]
            break
        if B - k < A + k:
            break

        l = l + [A+k]

        r = [B-k] + r
    return l + r


if __name__ == "__main__":
    A, B, K = map(int, input().split())
    ans = small_and_large_integers(A, B, K)
    for a in ans:
        print(a)

Solution (Python):
a,b,k=map(int,input().split())
lis=[]
for i in range(k):
    if a<=a+i<=b:
        lis.append(a+i)
for i in range(k):
    if a<=b-i<=b:
        lis.append(b-i)
ans=list(set(lis))
ans.sort()
for i in range(len(ans)):
    print(ans[i])

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

Solution (Python):
A,B,K = map(int,input().split())
ansnums = [A+k for k in range(K) if A+K<=B]
ansnums.extend([B-k for k in range(K) if B-k>=A])
ansnums = sorted(set(ansnums))
for i in ansnums:
    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 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])

Solution (Python):

A, B, K = map(int, input().split())
ans = []
for i in range(K):
    a, b = A + i, B - i
    if a < b:
        ans.extend([a, b])
    elif a == b:
        ans.append(a)
    else:
        break
ans.sort()
for a in ans:
    print(a)

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

Solution (Python):
A, B, K = map(int, input().split())
lst1 = [x for x in range(A, A + K) if x <= B]
lst2 = [x for x in range(B, B - K, -1) if x >= A]
for n in sorted(set(lst1 + lst2)):
    print(n)

Solution (Python):
def main():
    A, B, K = map(int, input().split())
    x = A
    while x <= B and x <= A+K-1:
        print(x)
        x += 1
    x = max(x, B-K+1)
    while x <= B:
        print(x)
        x += 1


if __name__ == "__main__":
    main()

Solution (Python):
a, b, k = map(int, input().split())
ans = []
if 2 * k > b - a:
	for i in range(a, b + 1):
		print(i)
	exit()
for i in range(a, a + k):
	ans.append(i)
for i in range(b - k + 1, b + 1):
	ans.append(i)
ans.sort()
for i in range(len(ans)):
	print(ans[i])

Solution (Python):


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

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


if __name__ == '__main__':
    main()

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):
import sys

def main():
  input = sys.stdin.readline
  A, B, K = map(int, input().split())
  ans = list(range(A, min(A+K, B))) + list(range(max(B-(K-1), A), B+1))
  ans = sorted(list(set(ans)))
  for i in ans:
    print(i)


if __name__ == '__main__':
  main()

Solution (Python):
A,B,K=(int(i) for i in input().split())
a=B-A+1
if K>=a:
  for i in range(A,B+1):
    print(i)
else:
  L1=list(range(A,A+K))
  L2=list(range(B-K+1,B+1))
  S=list(set(L1+L2))
  S.sort()
  for i in S:
    print(i)

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())

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

Solution (Python):

a, b, k = [int(x) for x in input().split()]
s = list(range(a, b + 1)[:k])
t = list(range(a, b + 1)[-k:])
for v in sorted(set(s + t)):
    print(v)

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

Solution (Python):
A, B, K = map(int, input().split())
L = []
for a in range(A, min(A + K, B + 1)):
    L.append(a)
for b in range(max(B - K + 1, A + 1), B + 1):
    if b not in L:
        L.append(b)
for l in L:
    print(l)

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

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

Solution (Python):
def main():
    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(K):
            print(A+i)
        for i in range(K):
            print(B-K+1+i)


if __name__ == "__main__":
    main()

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

for a in sorted(list(set(range(A,min(B+1,A+K))+range(max(A,B-K+1),B+1)))):
  print a

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

Solution (Python):
a,b,k=map(int,input().split());r=range(a,b+1);print(*sorted(set(r[:k])|set(r[-k:])),sep='\n')

Solution (Python):
a,b,k=map(int,input().split());r=range(a,b+1);print(*sorted(set(r[:k])|set(r[-k:])),sep='\n')

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

S = list(range(A, min(A+K, B)))
L = list(range(max(B-K+1, A), B+1))

ans = list(sorted(list(set(S + L))))

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

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

S = list(range(A, min(A+K, B)))
L = list(range(max(B-K+1, A), B+1))

ans = list(sorted(list(set(S + L))))

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

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

st=a
while st<=min(a+k-1,b) :
    print(st)
    st+=1
st=max(st,b-k+1)
while st<=b :
    print(st)
    st+=1

Solution (Python):
a, b, k = map(int, input().split())
li = []
for i in range(a, a + k):
    if b < i:
        break
    li.append(i)
for i in range(b - k + 1, b + 1):
    if i < a:
        continue
    li.append(i)
li = list(set(li))
li.sort()
for num in li:
    print(num)

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

numbers = []

for i in range(K):
  n, m = A + i, B - i
  
  if A <= n <= B and n not in numbers:
    numbers.append(n)
  if A <= m <= B and m not in numbers:
    numbers.append(m)

numbers.sort()

for n in numbers:
  print(n)

Solution (Python):
a,b,k=map(int,input().split());r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i)

Solution (Python):
a,b,k=map(int,input().split());s=list((range(a,b+1)[:k]))
for r in sorted(set([s,s+list(range(a,b+1)[-k:])][b>k])):print(r)

Solution (Python):
a,b,k=map(int,input().split())
s=list((range(a,b+1)[:k]))
t=list(range(a,b+1)[-k:])
for r in sorted(set([s,s+t][b>k])):print(r)

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

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

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

e = list(s)
e.sort()
for i in e:
    print(i)

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

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

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

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

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())
X=[]
for i in range(a,a+k):
    if i>b:
        break
    X.append(i)
    
    
for j in range(b-k+1,b+1):
    if j<a:
        break
    X.append(j)
    
X=set(X)
X=list(X)
X.sort()

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

Solution (Python):

import sys



def solve(lines):
    A,B,K = map(int, lines.pop(0).split(' '))
    NLIST = set()
    for i in range(K):
        if A+i <= B:
            NLIST.add(A+i)
        if A <= B-i:
            NLIST.add(B-i)

    NLIST = list(NLIST)
    NLIST.sort()
    for i in NLIST:
        print(i)




lines = [x.strip() for x in sys.stdin.readlines()]




solve(lines)

Solution (Python):

a, b, k = map(int, input().split())
ans_list = []
for i in range(a, a+k):
    if i <= b:
        ans_list.append(i)
for i in range(b-k+1, b+1):
    if i >= a:
        ans_list.append(i)
ans_list = list(set(ans_list))
ans_list.sort()

for i in ans_list:
    print(i)

Solution (Python):
a,b,k=map(int,input().split())
l=range(a,b+1)
la= set(l[:k]) | set(l[-k:])
for i in (sorted(la)):
  print(i)

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

Solution (Python):
a,b,k = map(int,input().split())
ans = [a+i for i in range(k) if a+i <= b] + [b-i for i in range(k) if b-i >= a]
ans = list(set(ans))
ans.sort()

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

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

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

Solution (Python):
a,b,k=map(int,input().split())
atmp=a; btmp=b;
ans=set()

for i in range(1,k+1):
    ans.add(atmp)
    atmp+=1
    if atmp>b:
        break

for i in range(1,k+1):
    ans.add(btmp)
    btmp-=1
    if btmp<a:
        break

ans=sorted(ans)
for i in range(len(ans)):
    print(ans[i])

Solution (Python):
int_a, int_b, int_k = map(int, input().split())

minset = set(range(int_a, int_a + int_k))
maxset = set(range(int_b - int_k + 1, int_b + 1))

result = list(minset | maxset)
result.sort()
for i in result:
    if int_a <= i <= int_b:
        print(i)

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

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

s = set()

for i in range(A, min(A + K, B + 1)):
    s.add(i)

for i in range(B, max(A - 1, B - K), -1):
    s.add(i)

s = sorted(s)

for i in s:
    print(i)

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

Solution (Python):
a, b, k = map(int, input().split())
l = [i for i in range(a, min(a+k,b+1))] + [i for i in range(max(a, b-k+1), b+1)]
for i in sorted(set(l), key=l.index):
  print(i)

Solution (Python):
a,b,k=[int(i) for i in input().split()]
ans=[]
if k<b-a:
    for i in range(a,a+k):
        if (i in ans)==False:
            ans.append(i)
    for i in range(b-k+1,b+1):
        if (i in ans)==False:
            ans.append(i)
    result=sorted(ans)
else:
    result=[i for i in range(a,b+1)]
for i in range(len(result)):
    print(result[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)
    exit(0)
for i in range(a,a+k):
    print(i)
for i in range(b-k+1,b+1):
    print(i)

Solution (Python):
n,m,k = map(int,input().split())
l = []
for i in range(n,n+k):
    if n <= i <= m:
        l.append(i)
for i in range(m,m-k,-1):
    if n <= i <= m:
        l.append(i)
l = sorted(set(l))
for i in range(len(l)):
    print(l[i])

Solution (Python):
import math
A, B, K = map(int, input().split())
l = []
for k in range(min([K, math.floor((B - A + 1)/2)])):
    l.append(k + A)
for k in range(min([K, math.ceil((B - A + 1) / 2)])):
    l.append(B - k)
l.sort()
for i in l:
  print(i)

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


main()

Solution (Python):

a,b,k = map(int,input().split())
xx =[]
for x in range(a,a+k):
    if x>b:
        break
    xx.append(x)
for x in range(b+1-k,b+1):
    if x<a:
        break
    xx.append(x)
for x in sorted(list(set(xx))):
    print(x)

Solution (Python):
""" AtCoder """

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

l = []

ans = []

if B - A < K:
    for i in range(A, B + 1):
        ans.append(i)
else:
    for i in range(A, A + K + 1):
        l.append(i)
    for i in range(B - K, B + 1):
        l.append(i)
    for i in range(K):
        ans.append(l[i])
        ans.append(l[-i-1])

ans = set(ans)

ans = sorted(ans)

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

Solution (Python):
""" AtCoder """

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

l = []
for i in range(A, A + K + 1):
    l.append(i)
for i in range(B - K, B + 1):
    l.append(i)

ans = []

if B - A < K:
    for i in range(A, B + 1):
        ans.append(i)
else:
    for i in range(A, A + K + 1):
        l.append(i)
    for i in range(B - K, B + 1):
        l.append(i)
    for i in range(K):
        ans.append(l[i])
        ans.append(l[-i-1])

ans = set(ans)

ans = sorted(ans)

for i in range(len(ans)):
    print(ans[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())
if k*2>(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, 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(" "))
list = []

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

Solution (Python):
from statistics import mean, median,variance,stdev
import sys
import math
import fractions

def j(q):
    if q==1: print("AC")
    else:print("WA")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())



a,b,k = (int(i) for i in input().split())    







c = [ i for i in range(a,min(b,a+k))]
d = [ i for i in range(max(b-k+1,a),b+1)]
e = set()
for i in range(len(c)):
    e.add(c[i])
for i in range(len(d)):
    e.add(d[i])
e = list(e)
e.sort()
for i in range(len(e)):
    print(e[i])

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

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

Solution (Python):
a,b,c=map(int,input().split())
v=set([])
if b-a<c:
    c=b-a
if a==b:
    print(a)
for i in range(c):
    v.add(a+i)
    v.add(b-i)
l=list(v)
l.sort()
for i in range(len(l)):
    print(l[i])

Solution (Python):

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


sep = b - a > 2 * (k - 1)

if sep:
    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())
ans=[]
if k>=(b-a+1)/2:
  ans=list(range(a,b+1))
else:
  ans=list(range(a,a+k))
  ans_back=list(range(b+1-k,b+1))
  ans.extend(list(range(b+1-k,b+1)))
for i in ans:
  print(i)

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

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

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

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

Solution (Python):
a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):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 i in range(b-k+1,b+1):
    print(i)

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

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

a=A
b=B
list=[]
while a<A+K and a<=b:
    list.append(a)
    a+=1

while b>B-K and b>=a:
    list.append(b)
    b-=1

list.sort()
ANS=set(list)
ANS=sorted(ANS)

for ans in ANS:
    print(ans)

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

    ans = set()

    for i in range(k):
        x = a + i
        if x <= b:
            ans.add(x)

        y = b - i
        if a <= y:
            ans.add(y)

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


def main2():
    a, b, k = map(int, input().split())
    ans = []
    if 2 * k >= b - a + 1:
        for i in range(a, b + 1):
            ans.append(i)
    else:
        for i in range(k):
            ans.append(a + i)
            ans.append(b - i)

    for i in sorted(ans):
        print(i)


if __name__ == '__main__':
    main2()

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

    ans = set()

    for i in range(k):
        x = a + i
        if x <= b:
            ans.add(x)

        y = b - i
        if a <= y:
            ans.add(y)

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


def main2():
    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)
    else:
        for i in range(a, b + 1):
            ans.append(i)

    for i in sorted(ans):
        print(i)


if __name__ == '__main__':
    main2()

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

    ans = set()

    
    

    for i in range(k):
        x = a + i
        if x <= b:
            ans.add(x)

        y = b - i
        if a <= y:
            ans.add(y)

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


if __name__ == '__main__':
    main()

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

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

ans1 = set(range(A, min(A+K, B+1)))
ans2 = set(range(max(A, B-K+1), B+1))

print('\n'.join(map(str, sorted(ans1 | ans2))))

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

a -= 1
for _ in range(c):
  a += 1
  print(a)
  if a == b:
    break

b=b-c+1

for _ in range(c):
  if b > a:
    print(b)
  b=b+1

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

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

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

sub1 = [i for i in range(A,A+K)]
sub2 = [i for i in range(B-K+1,B+1)]
sub = set(sub1) | set(sub2)
sub = sorted(sub)
for i in sub:
    if A<= i <= B:
        print(i)

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

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

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

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

    for i in ans:
        print(i)

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

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

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

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 j in range(a,a+k):
    print(j)
  for l in range(b-k+1, b+1):
    print(l)

Solution (Python):


def main():
    na = list(map(int, input().split()))
    A, B, K = na[0], na[1], na[2]

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



if __name__ == '__main__':
    main()

Solution (Python):
a,b,k=map(int,input().split())
if b-k+1<=a+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):
A, B, K = [int(x) for x in input().split()]

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

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

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

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

ans = '\n'.join(map(str, l))
print(ans)

Solution (Python):
A, B, K = map(int, str(input()).split(" "))
disp = []
for i in [j for j in range(A, A + K) if j <= B]:
    disp.append(i)
for i in [j for j in range(B - K + 1, B + 1) if A <= j]:
    disp.append(i)
for i in sorted(set(disp)):
    print(i)

Solution (Python):
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)
ans = list(set(ans))
ans.sort()

for i in ans:
    print(i)

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=sorted(list(ans))

for a in ans:
    print(a)

Solution (Python):
def inpl(): return [int(i) for i in input().split()]
A, B, K = inpl()
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())
if A+K-1>=B-K+1:
    while A<=B:
        print(A)
        A+=1
else:
    i=0
    while i<=K-1:
        print(A+i)
        i+=1
    while B-K+1<=B:
        print(B-K+1)
        K-=1

Solution (Python):
A, B, K = map(int, input().split())
if B - A < K + 1:
    c = list(range(A, B + 1))
else:
    a = list(range(A, A + K))
    b = list(range(B - K + 1, B + 1))
    c = sorted(list(set(a + b)))
for i in range(len(c)):
    print(c[i])

Solution (Python):
a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):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 = []
for i in range(A, B+1)[:K]:
  ans.append(i)
for i in range(A, B+1)[-K:]:
  ans.append(i)
for a in sorted(list(set(ans))):
  print(a)

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

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

ans_array = []

for i in range(A, A + K if B > (A + K) else (B+1)):
    ans_array.append(i)

for i in range(B, B - K if A < (B - K) else (A-1), -1):
    ans_array.append(i)

ans_array = sorted(list(set(ans_array)))

for i in ans_array:
    print(i)

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

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

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

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

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

Solution (Python):

import sys
input = sys.stdin.readline

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

Solution (Python):

import sys
input = sys.stdin.readline

A, B, K = map(int, input().split())
diff = B - A
if diff < 2*K:
    for c in range(A, B+1):
       print(c)
else:
    for a in range(A, A+K):
        print(a)
    for b in range(B-K+1, B+1):
        print(b)