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 math
import string


def readints():
    return list(map(int, input().split()))


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


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

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

ll = sorted(set(l))
for i in range(len(ll)):
    print(ll[i])

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=sorted(s)
for x in s:
    print(x)

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

Solution (Python):
'''
A 以上 B 以下の整数、小さい方 K 番目以内、大きい方 K 番目以内、昇順

制約
1 <= A <= B <= 10 の 9 乗
1 <= K <= 100

A と B の 間 を 全探索 したら TLE となる。
A と B の 間 は 最大で 10 の 9 乗 離れている為。

次に素直に A から K 個 取り、B から K 個 取り、集合に格納する。
これも A から K 個 取った時に、Bを超えるとダメで、逆も同様。

そこで、in range の 終了条件に min max を使う。
min(A + K, B + 1) ならば A + K - 1 と B のうち、小さい方までとなる。
max(A - 1, B - K) ならば A と B - K + 1のうち、大きい方までとなる。

in range の 終了条件 の インデックス 自体 は 含まず
一つ前のまでとなるので注意する。
'''


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


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

ans = []

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

for i in range(max(a, 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())

if 2*k < b-a:
    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 and i < a+k) or (b-k < i and i <= b):
            print(i)

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

Solution (Python):

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

Solution (Python):

def main():
    import sys
    
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    
    from itertools import combinations, permutations
    
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    

    

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


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

A, B, K = na()

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:
    num_list = [i for i in range(A,B+1)]
    
    for i in range(K):
        if len(num_list)<=0:
            break
        n = num_list[0]
        print(n)
        num_list.remove(n)

    
    output_list = []
    for i in range(K):
        if len(num_list)<=0:
            break
        n = num_list[-1]
        output_list.append(n)
        num_list.remove(n)

    output_list = output_list[::-1]

    for o in output_list:
        print(o)
else:
    num_list_1 = [i for i in range(A, A+K+1)]
    num_list_2 = [i for i in range(B-K+1, B+1)]
    
    for i in range(K):
        n = num_list_1[i]
        print(n)

    
    for i in range(K):
        n = num_list_2[i]
        print(n)

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

Solution (Python):
A,B,C=map(int,input().split())
L=[]
for i in range (C):
	if A+i>=A and A+i<=B:
		L.append(A+i)
	if B-i>=A and B-i<=B:
		L.append(B-i)
X=sorted(set(L))
for i in range (len(X)):
	print(X[i])

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

ans1 = list(range(A, B + 1)[:K])
ans2 = list(range(A, B + 1)[-K:])
for i in sorted(set(ans1 + ans2)):
    print(i)

Solution (Python):
A,B,K=map(int,input().split(' '))
l1 = [i for i in range(A,min(B+1,A+K))]
l2 = [i for i in range(max(B-K+1,A),B+1)]
for i in sorted(list(set(l1+l2))):
    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())
ans_set= set()
for i in range(a, min(a+k, b+1)):
    ans_set.add(i)
for i in range(b, max(b-k, a-1), -1):
    ans_set.add(i)
ans = list(ans_set)
ans.sort()
for i in range(len(ans_set)):
    print(ans[i])

Solution (Python):








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

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


        for i in ans:
            print(i)


resolve()

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

Solution (Python):
a,b,k=map(int,input().split())
ans=[]
for i in range(k):
    if a<=a+i and a+i<=b:
        ans.append(a+i)
    if a<=b-i and b-i<=b:
        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 = []
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 = list(set(ans))
ans.sort()
for h in ans:
    print(h)

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())
num=set([])
for i in range(a,min(a+k,b+1)):
    num.add(i)

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

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

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

num = b-a
l = []
if num > k:
    for i in range(a,a+k):
        l.append(i)
    for i in range(b-k+1, b+1):
        l.append(i)
    for x in sorted(list(set(l))):
        print(x)
else:
    for i in range(a,b+1):
        print(i)

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

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

if a+k <= b-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())

if (B-A)*0.5+1<=K:
    for i in range(A,B+1):
        print(i)
else:
    _list=[]
    for i in range(K):
        _list.append(A+i)
        _list.append(B-i)
    _list.sort()
    for i in _list:
        print(i)

Solution (Python):
a, b, k = [int(x) for x in 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:
    num_list = [i for i in range(A,B+1)]
    
    for i in range(K):
        if len(num_list)<=0:
            break
        n = num_list[0]
        print(n)
        num_list.remove(n)

    
    output_list = []
    for i in range(K):
        if len(num_list)<=0:
            break
        n = num_list[-1]
        output_list.append(n)
        num_list.remove(n)

    output_list = output_list[::-1]

    for o in output_list:
        print(o)
else:
    num_list_1 = [i for i in range(A, A+K+1)]
    num_list_2 = [i for i in range(B-K+1, B+1)]
    
    for i in range(K):
        n = num_list_1[i]
        print(n)

    
    for i in range(K):
        n = num_list_2[i]
        print(n)

Solution (Python):
A,B,K = map(int,input().split())
n = 0
ans = []
for i in range(K):
  n = i
  if A+i <= B:
    ans.append(A+i)
  else:    
    break
for j in range(K-1,-1,-1):
  if B-j > A+n:
    ans.append(B-j)
ans.sort()
for k in range(len(ans)):
  print(ans[k])

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)

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

Solution (Python):


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

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

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

if abs(A-B)<=K:
    for i in range(A,B+1):
        print(i)
    exit()
a=set()
for i in range(A,A+K):
    a.add(i)
    print(i)
for i in range(B-K+1,B+1):
    if i in a:
        continue
    print(i)

Solution (Python):
import sys
input=sys.stdin.readline
a,b,k=map(int,input().split())
L=[]
for i in range(k):
    if a+i<=b and b-i>=a:
        L.append(a+i)
        L.append(b-i)
L=sorted(list(set(L)))
for i in L:
    print(i)

Solution (Python):
a, b, k = map(int, input().split())
c = []
for i in range(min(k, b-a+1)):
  c.append(a+i)
  c.append(b-i)
c.sort()
c = sorted(set(c))
for i in c:
  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)
li=sorted(s)
for i in li:
    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 = sorted(list(set(ans)))
print(*ans,sep="\n")

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

ans=[]
for i in range(K):
    if A+i<=B:
        ans.append(A+i)
    if B-i>=A:
        ans.append(B-i)

ans=sorted(list(set(ans)))
print(*ans, sep='\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 = [int(i) for i in input().rstrip().split()]

if K <= (B-A+1)/2:
  print(*( list(range(A,A+K)) + list(range(B-K+1,B+1)) ),sep="\n")
else:
  print(*list(range(A,B+1)),sep="\n")

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

hako = {}
for i in range(A, A + K):
    if i <= B:
        hako[i] = 0
for j in range(B, B - K, -1):
    if j >= A:
        hako[j] = 0

for k in sorted(hako):
    print(k)

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

tmp = range(a, b+1)
for a in sorted(set(tmp[:k]) | set(tmp[-k:])):
    print(a)

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

for x in range(K):
    if B >= A+x or B-x >= A:
        X.append(A+x)
        X.append(B-x)

sortX = sorted(set(X))

for x in sortX:
    print(x)

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

if b-a <= k:
    L = list(range(a,b+1))
else:
    i = list(range(a,a+k))
    j = list(range(b-k+1,b+1))

    L = list(set(i+j))
    L = sorted(L)
    
for i in L:
    print(i)

Solution (Python):
A, B, K = map(int, input().split())
if A==B:
    print(A)
    exit()
ans_dic={}
A_K = A+K if A+K <= B else B
for i in range(A, A_K):
    ans_dic[i] = 1
K_B = B-K if B-K >= A else A
for i in range(B, K_B, -1):
    if i in ans_dic:
        pass
    else:
        ans_dic[i] = 1
for i, v in sorted(ans_dic.items()):
    print(i)

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

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    a, b, k = list(map(int, readline().split()))
    res = []
    for i in range(a, min(a + k, b + 1)):
        res.append(i)
    for i in range(b, max(b - k, a - 1), -1):
        if i not in res:
            res.append(i)
    print(*sorted(res), sep="\n")


if __name__ == '__main__':
    solve()

Solution (Python):
a, b, k = map(int, input().split())
result_a = [i for i in range(a, min(b+1,a+k))]
result_b = [i for i in range(max(a,b-k+1), b+1)]
result_a.extend(result_b)
result = set(result_a)
for i in sorted(result):
    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())
l = []
for i in range(k):
    if i + a <= b:
        l.append(i+a)
    if b-i>=a:
        l.append(b-i)
l = sorted(list(set(l)))
for j in range(len(l)):
    print(l[j])

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

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

Solution (Python):
a,b,x = map(int, input().split())
l = list()
for i in range(x):
    if a <= a+i <= b:
        l.append(a+i)
    if a <= b-i <= b:
        l.append(b-i)
l = sorted(set(l))
for i in l:
    print(i)

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

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

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

A = []
for i in range(a, min(a + k, b + 1)):
    A.append(i)

for i in range(b, max(b - k, a - 1), -1):
    A.append(i)

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

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

D={}
for i in range(A,min(A+K,B)):
    D[i]=1
for i in range(max(B+1-K,A),B+1):
    D[i]=1
L=list(D)
L.sort()

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

Solution (Python):
a,b,k = map(int,input().split())
L1 = list(range(a,a+k))
L2 = list(range(b-k+1,b+1))
L3 = L1 + L2
ans1 = sorted(set(L3))
if (b-a+1) <= k:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(len(ans1)):
        print(ans1[i])

Solution (Python):
a, b, k = map(int, input().split())
ans = set([])
num_a, num_b = a, b
for _ in range(k):
    if num_a <= b:
        ans.add(num_a)
        num_a += 1
    if a <= num_b:
        ans.add(num_b)
        num_b -= 1
ans = list(ans)
ans.sort()
print("\n".join(list(map(str, ans))))

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())
L=[]
for i in range(K):
    if a+i>b:
        break
    L.append(a+i)
    L.append(b-i)
L=sorted(list(set(L)))
for a in L:
    print(a)

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

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

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

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())
answer = set([])
for i in range(A, min(A+K, B+1)):
    answer.add(i)
    
for i in range(max(A, B-K+1), B+1):
    answer.add(i)
    

ordered_answer = sorted(answer)

for i in ordered_answer:
    print(i)

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

c = b-a+1

x = []
if k*2 > c:
    for i in range(a, b+1):
        x.append(i)
else:
    for j in range(a, a+k):
        x.append(j)
    for j in range(b-k+1, b+1):
        x.append(j)

print(*sorted(x), sep='\n')

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

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

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

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

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())
if (B-A) // K < 2 or (B-A) / 2 == 0:
    L = []
    for i in range(A, B+1):
        L.append(str(i))
    print(' '.join(L))
else:
    L = []
    R = []
    for i in range(A, A+K):
        L.append(str(i))
    for j in range(B-K+1, B+1):
        R.append(str(j))
    ans = L + R
    print(' '.join(ans))

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

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


A = []

for i in range(c):
    A.append(a+i) if a <= a+i <= b else a
j = 0
for _ in range(c):
    A.append(b - j) if a <= b - j <= b else a
    j += 1
A = list(sorted(set(A)))

for i in A:
    print(i)

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

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


lis=list(set(lis)) 
lis.sort()
for i in lis:
    print(i)

Solution (Python):

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

S = set(L)
L = list(S)
L.sort()
for i in range(len(L)):
    print(L[i])

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

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

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

Solution (Python):
def main():
    lower_limit, upper_limit, ranges = map(int, input().split(" "))
    for i in range(lower_limit, min(lower_limit + ranges, upper_limit + 1)):
        print(i)
    for i in range(max(upper_limit - ranges + 1, lower_limit + ranges), upper_limit + 1):
        print(i)


if __name__ == '__main__':
    main()

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

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

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

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

for i in res_list:
    print(i)

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

Solution (Python):
a,b,k = map(int,input().split())
ans = []
right = min(a+k,b+1)
for i in range(a,right):
    print(i)
left = b-k+1
if b-k < a+k:
    left = a+k
for i in range(left,b+1):
    print(i)

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

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

for i in range(B,B-K,-1):
  if (i >= A) and (i <= B):
    _.add(i)
  
_ = sorted(_)
for i in _:
  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 a == b:
    print(a)
    quit()
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):




def main():
    A, B, K = map(int, input().split())
    AK = [i for i in range(A, min(B + 1, A + K))]
    BK = [i for i in range(max(A, B - K + 1), B + 1)]

    result = list(set(AK) | set(BK))
    result.sort()

    for i in result:
        print(i)


if __name__ == "__main__":
    main()

Solution (Python):
from collections import OrderedDict
if __name__ == "__main__":
    a, b, k = map(int, input().split())

    output = OrderedDict()

    for i in range(k):
        if a<= a+i <= b:
            output[a+i] = a+i
    
    for i in range(-k+1,1):
        if a<= b+i <= b:
            output[b+i] = b+i
    
    for o in output.keys():
        print(o)

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

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

answer = list(set(ak) | set(bk))
answer.sort()
print(*answer, sep='\n')

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

for x in h:
    print(x)

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

Solution (Python):
a,b,k=map(int,input().split())
if b-a+1>k:
	a=list(range(a,a+k))
	b=list(range(b-k+1,b+1))
	ans=list(set(a+b))
	ans.sort()
else:
	ans=list(range(a,b+1))
print(*ans,sep='\n')

Solution (Python):
A, B, K = map(int, input().split())
ans = set([_ for _ in range(A, min(A + K, B+1))])
ans |= set([_ for _ in range(B, max(A, B-K), -1)])
for num in sorted(list(ans)):
    print(num)

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

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

cnt = 0
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(a, a+k):
    if i > b:
        break
    ans.append(i)

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

for i in ans:
    print(i)

Solution (Python):
a, b, k = map(int, input().split())
s = set(range(a, min(b + 1, a + k)))
s.update(range(b, max(a - 1, b - k), -1))
s = sorted(s)
print('\n'.join(map(str, s)))

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

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b,c=INTM()
    ans=[]
    for i in range(c):
        ai=a+i
        bi=b-i
        if a<=ai and ai<=b:
            ans.append(ai)
        if a<=bi and bi<=b:
            ans.append(bi)
    ans=sorted(set(ans))
    for i in ans:
        print(i)
    
if __name__ == '__main__':
    do()

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

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

for aa in ans:
    print(aa)

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

Solution (Python):
a, b, k = map(int,input().split())
ans = []
if 2*k >= b-a+1:
    ans = list(range(a,b+1))

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

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

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

Solution (Python):
a,b,k = map(int, input().split())
left_n = a+k if a+k-1<=b else b+1
right_n = b-k+1 if b-k+1>=a else a

left = [i for i in range(a, left_n)]
right = [i for i in range(right_n, b+1)]

print(*sorted(set(left+right)), sep='\n')

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

ans = []
x = dict()
for i in range(K):
    c = A+i
    d = B-i
    x[c] = c
    x[d] = d

for idx in x:
    if A <= idx and idx <=B:
        ans.append(idx)

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

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

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

[print(x) for x in ans]

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

if(a+k <= b):
    for i in range(a, a+k):
        print(i)
        maximum = i
    for j in range(b-k+1, b+1):
        if(maximum < j):
            print(j)
        
else:
    for i in range(a, b+1):
        print(i)

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

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

a,b,k=map(int,input().split())
list=[]
if (b-a)<=k*2-1:
	for l in range(b-a+1):
		print(l+a)
	sys.exit()
for i in range(a,a+k):
	list.append(i)
for j in range(b,b-k,-1):
	list.append(j)
list.sort()
for k in range(len(list)):
	print(list[k])

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()
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=[]
for i in range(A, A+K):
    if i < A+K and i <= B:
        list.append(i)
for i in range(B-K, B+1):
    if i > (B-K) and i >= A:
        list.append(i)
for i in sorted(set(list)):
    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 range(a,min(a+k,b+1)):
    print(i)
    p=i
for i in range(max(p+1,b-k+1),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())
l=[]

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

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

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

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

if i > B:
    sys.exit()

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

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

Solution (Python):

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