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())
K = min(K, B - A + 1)
print(*sorted(set([i for i in range(A, A+K)] + [i for i in range(B-K+1, B+1)])), sep='\n')

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

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

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

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())
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 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-k+1,b+1):
        print(i)

Solution (Python):
A, B, K = map(int, input().split())
if B - A < 2 * K:
    print(*range(A, B + 1), sep="\n")
else:
    print(*range(A, A + K), sep="\n")
    print(*range(B - K + 1,  B + 1), sep="\n")

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




candidate = []

for i in range(A, min(A+K, B+1)):
  candidate.append(i)
  
for i in range(B, max(B-K, A-1), -1):
  candidate.append(i)
  
candidate = set(candidate)

for num in sorted(candidate, reverse=False):
  print(num)

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

Solution (Python):

import sys


def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

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

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

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

l       = range(A, B+1)

s       = sorted(set(l[:K])|set(l[-K:]))

for i in s:
    print(i)

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

Solution (Python):
import sys
import math
from fractions import gcd





def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""


 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())


 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

A, B, K =  map(int, sys.stdin.readline().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)

"""
X = [x for x in range(A, min(A + K, B + 1))] + [x for x in range(max(B - K + 1, A), B + 1)]
for x in sorted(list(set(X))):
    print(x)
"""

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(A+K, B+1-K), B+1):
    print(i)

Solution (Python):
import sys
import math
from fractions import gcd





def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""


 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())


 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

A, B, K =  map(int, sys.stdin.readline().split())
X = [x for x in range(A, min(A + K, B + 1))] + [x for x in range(max(B - K + 1, A), B + 1)]
for x in sorted(list(set(X))):
    print(x)

Solution (Python):


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


    if a+k > b:
        c = b
    else:
        c = a+k
    
    if a == c:
        c += 1

    for i in range(a,c):
        ansSet.add(i)
    
    if b-k < a:
        c = a
    else:
        c = b-k

    for i in range(b,c,-1):
        ansSet.add(i)

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


if __name__== "__main__":
    main()

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    a, b, k = list(map(int, input().rstrip('\n').split()))
    ans = []
    for i in range(a, min(a + k, b+1)):
        if i not in ans:
            ans.append(i)
    for i in range(b, max(b - k, a-1), -1):
        if i not in ans:
            ans.append(i)
    ans.sort()
    print(*ans, sep="\n")


if __name__ == '__main__':
    slove()

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

ans=[]
for i in range(k):
  if a+i<=b and a+i not in ans:
    ans.append(a+i)
for i in range(k):
  if b-i>=a and b-i not in ans:
    ans.append(b-i)
ans.sort()
print(*ans,sep='\n')

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

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

num = a
while num <= b and num < a + k:
  print(num)
  num += 1
  
num = max(num, b - k + 1)
while num <= b:
  print(num)
  num += 1

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

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

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

ans=set()
for i in range(a,a+k):
    ans.add(i)

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

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

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

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

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

for i in range(b-k+1,b+1):
    ans.append(i)

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

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

Solution (Python):
a,b,k=map(int,input().split())
aa=set(range(a,min(b+1,a+k)))
bb=set(range(max(b-k+1,a),b+1))
print(*sorted(aa|bb),sep='\n')

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

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

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

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

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

if (b-a)//2 + 1 <= 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):
import sys
from statistics import *
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

a, b, k = na()
ct = 0
li = []
for i in range(a, a + k):
    if i <= b:
        li.append(i)
for i in range(b - k + 1, b+1):
    if i >= a:
        li.append(i)
print(*(sorted(list(set(li)))))

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(0, K):
    print(A+i)
  for i in reversed(range(0, K)):
    print(B-i)

Solution (Python):
a,b,k=map(int, input().split())
s=[a+i for i in range(k) if a+i<=b]
t=[b-i for i in range(k) if b-i>=a]
u=sorted(list(set(s+t)))
for i in u:
    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());print(*(list(range(a,b+1))if b-a<2*k else list(range(a,a+k))+list(range(b-k+1,b+1))))

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

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

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

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    a, b, k = list(map(int, input().rstrip('\n').split()))
    ls = []
    for i in range(a, min(a + k, b)):
        if i not in ls:
            ls.append(i)
    for i in range(b, max(b - k, a - 1), -1):
        if i not in ls:
            ls.append(i)
    ls.sort()
    for i in ls:
        print(i)


if __name__ == '__main__':
    main()

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  >= 2*k:
    for i in range(a,a+k):
        print(i)
    for j in range(b-k+1,b+1):
        print(j)
else:
    for i in range(a,b+1):
        print(i)

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

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


if __name__ == "__main__":
    resolve()

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())
printed = set()
for i in range(K):
    if(A + i <= B):
        print(A + i)
        printed.add(A + i)
for i in range(K):
    if B - K + 1 + i >= A and B - K + 1 + i not in printed:
        print(B - K + 1 + i)

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())
x = range(a,b+1)
print(*sorted(set(x[:k])|set(x[-k:])),sep='\n')

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

Solution (Python):
a,b,k = map(int,input().split())
A = {i for i in range(a,a+k) if i >=a and i <=b}
B = {j for j in range(b-k+1,b+1) if j >=a and j <=b}
print(*sorted(A|B),sep="\n")

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

Solution (Python):
a, b, k = map(int, 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 i in range(len(ans)):
    print(ans[i])

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

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

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

else:
    if A + K - 1 < B and A <= B - K + 1:
        ans = [A + i for i in range(K)] + [B - i for i in reversed(range(B - (A + K - 1)))]
    else:
        ans = [i for i in range(A,B+1)]

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

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

if __name__ == '__main__':
    main()

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

Solution (Python):
a,b,x=map(int,input().split())
A=sorted(set(range(a,min(a+x,b+1)))|set(range(max(b-x+1,a),b+1)))
print(*A,sep='\n')

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

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

Solution (Python):
a,b,k = map(int,input().split())
x = range(a,b+1) 
if b-a+1 < k*2:
  print(*x,sep="\n")
else:
  print(*x[:k],sep="\n")
  print(*x[-k:],sep="\n")

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

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

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

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

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

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())
ans = []

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

for i in sorted(set(ans)):
    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())

x=list(set( [i for i in range(a,min(a+k,b+1), 1)] + \
            [i for i in range(b,max(b-k,a-1),-1)] ))
print(*sorted(x),sep='\n')

Solution (Python):
a,b,k=map(int,input().split())
ans=[]
for i in range(k):
    if a+i>b or b-i<a:
        break
    ans.append(a+i)
    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())
li1 = range(a,a+k)
li2 = range(b-k+1,b+1)
se1=set(li1)
se2=set(li2)
se=sorted(se1|se2)
for i in se:
    if a<=i<=b:
        print(i)

Solution (Python):
A, B, K = [int(x) for x in input().split()]
if K >= (B - A + 1) / 2:
  l = [i for i in range(A, B + 1)]
else:
  l = [i for i in range(A, A + K)]
  l += [i for i in range(B - K + 1, B + 1)]

for i in l:
  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())
s = {a, b}
for i in range(k):
    s.add(min(b, a + i))
    s.add(max(a, b - i))
print(*sorted(s), sep=' ')

Solution (Python):
import collections
a, b, k = map(int, input().split())
ans = [a, b]
for i in range(a, min(a + k, b )):
    if i not in ans:
        ans.append(i)
for i in range(b, max(b - k, a), - 1):
    if i not in ans:
        ans.append(i)
ans = collections.Counter(ans).most_common()
ans.sort()
for i in ans:
    print(i[0])

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

Solution (Python):

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


'''
for i in range(b-a+1):
    if i<k:
        print(a+i)
    elif i>b-a-k:
        print(a+i)
'''

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

for i in sorted(set(d)):
    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(max(b-k+1, a), b+1):
    s.add(i)
s = list(sorted(s))

for n in s:
    print(n)

Solution (Python):
a,b,k=map(int,input().split())
line=[]
for i in range(a,a+k):
    if i>b:break
    else:
        if i not in line:
            line.append(i)

for i in range(b,b-k,-1):
    if i<a:break
    else:
        if i not in line:
            line.append(i)

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

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

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

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

Solution (Python):
a,b,x = map(int,input().split())
a_set = set(range(a,min(a+x,b)))
b_set = set(range(max(a,b-x+1),b+1))




a_set = a_set.union(b_set)
ans_list = list(a_set)
ans_list.sort()
for ans in ans_list:
  print(ans)

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(max(B-K+1,A), B+1):
    s.add(i)
S=list(sorted(s))
for i in range(len(S)):
    print(S[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(A+K,B-K+1),B+1):
    print(i)

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

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(b, max(b - k, a - 1), -1):
    if i not in l:
        l.append(i)
l.sort()
for i in l:
    print(i)

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(' '))
A = list(filter(lambda x: x <= b, [i for i in range(a, a+k)]))
B = list(filter(lambda x: x >= a, [i for i in range(b-k+1, b+1)]))
print('\n'.join(map(str, sorted(list(set(A+B))))))

Solution (Python):
import sys
input=sys.stdin.readline

a,b,k = map(int, input().split())
x = []
for i in range(a,a+k):
    if a <= i and i <= b:
        x.append(i)
for i in range(b-k+1,b+1):
    if a <= i and i <= b:
        x.append(i)

x = list(set(x))
x.sort()

for i in x:
    print(i)

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

Solution (Python):
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))
E = sorted(list(ans))
for e in E:
    print(e)

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

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

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

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

Solution (Python):
a,b,k = map(int,input().split())
l = []
for i in range(k):
    if a+i<=b:
        l.append(a+i)
for i in range(k-1,-1,-1):
    if b-i>=a and not b-i in l:
        l.append(b-i)
l.sort()
for i in range(len(l)):
    print(l[i])

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

for j in range(A,A+K):
    if B >= j:
        print(j)

for j in range(B-K+1,B+1):
    if A + K - 1 < j :
        print(j)

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

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

Solution (Python):
a,b,k=map(int,input().split())
S=sorted(set(range(a,min(a+k,b+1))) | set(range(max(b+1-k,a),b+1)))
print(*S,sep="\n")

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

for i in range(A,A+K):
	if i <= B:
		ans.append(i)

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

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

for i in ans:
	print(i)

Solution (Python):
a, b, c = map(int, input().split())
d = []
for i in range(a, a + c):
    if i not in d and i <= b:
        d.append(i)
for i in range(b, b - c, -1):
    if i not in d and i >= a:
        d.append(i)
d.sort()
for i in d:
    print(i)

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

ans=list(set(list(i for i in range(a,a+k,1) if i<=b)+list(j for j in range(b,b-k,-1) if j>=a)))

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

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

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

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

Solution (Python):
A, B, K = list(map(int,input().split(' ')))
'''
x = [i for i in range(A,B+1)]
s_f,s_b = x[:K],x[len(x)-K:]
ans = s_f + s_b
ans =list(set(ans))

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

'''
if (B-A+1)<K:
  s =  list(range(A,B+1))
  [print(i) for i in s]
else:           
  s_f = list(range(A,A+K))
  s_b = list(range(B,B-K,-1))
  ans = s_f + s_b
  ans =list(set(ans))
  ans.sort()
  [print(i) for i in ans]

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

Solution (Python):
a,b,k=map(int,input().split())
A=a;B=b
l=set([])
for i in range(k):
  if B>=a:l.add(a)
  if A<=b:l.add(b)
  a+=1;b-=1
m=sorted(l)
for x in m:print(x)

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

if K >= B-A+1:
    ans = list(range(A, B+1))
else:
    ans = list(range(A, A+K)) + list(range(max(A+K, B-K+1), B+1))

for a in ans:
    print(a)

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

AK = A+K-1
BK = B-K+1
for i in range(A,A+K):
  if i <= B:
    if i >= A and i <= AK:
      print(i)
for i in range(BK,B+1): 
  if (i <= AK)!=1:
    if i >= BK and i <= B:
      print(i)

Solution (Python):
a,b,k = map(int,input().split())
se = set(range(a,a+k)) | set(range(b-k+1,b+1))
li = list(se)
li = [x for x in li if a<=x<=b]
li.sort()
print(*li,sep='\n')

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

for i in ll:
    print(i)

Solution (Python):

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


if k >= (b-a+1)/2:
    [print(x) for x in range(a, b+1)]
else:
    [print(x) for x in range(a, a+k)]
    [print(x) for x in range(b-k+1, b+1)]

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

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

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

Solution (Python):
import math



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






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

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

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

low = [a + i for i in range(0, k)]
high = [b - i for i in range(0, k)]
res = set(low + high)

res = sorted(filter(lambda s: a <= s <= b, res))

for x in res:
    print(x)

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

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

if k * 2 > (b - a):
    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())
tmp = [0] * K
for i in range(K):
    aTmp = A + i
    if B >= aTmp:
        print(aTmp)
        tmp[i] = aTmp

for i in range(K):
    bTmp = B - K + 1 + i
    if tmp.count(bTmp) == 0 and A <= bTmp:
        print(bTmp)

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

i = a
while i < a+k:
  if i <= b:
    l.append(i)
  i += 1

i = b-k+1
while i <= b:
  if a <= i:
    l.append(i)
  i += 1

l = list(set(l))
l.sort()

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

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

ans = {i for i in range(a, min(a+k, b))} | {i for i in range(max(a, b+1-k), b+1)}
ans = sorted(ans)
for i in ans:
    print(i)

Solution (Python):
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):
  nums.append(num)
ans = sorted(set(nums))
for num in ans:
  print(num)

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

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

Solution (Python):
a, b, c = map(int, input().split())
d = {}
for i in range(a, min(a + c, b+1)):
    d[i] = 1
for i in range(b, max(b - c, a-1), -1):
    d[i] = 1
d = sorted(d.keys())
for i in d:
    print(i)

Solution (Python):
a, b, k = map(int,input().split())
c = b - a + 1
if k > c:
  for i in range(a, b+1):
    print(i)
else:
  l = list(range(a, a+k))
  l1 = list(range(b-k+1, b+1))
  l2 = l + l1
  l3 = set(l2)
  l4 = sorted(l3)
  for i in l4:
    print(i)

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