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



Sample input:
3 8 2


Sample output:
3
4
7
8

Submission status: Accepted

Solution code:
# Author: cr4zjh0bp
# Created: Thu Mar 12 19:09:40 UTC 2020
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)

Submission status: Accepted

Solution code:
# Problem B - Small and Large Integers

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

# initialization

if B-A<=2*K:
    num_list = [i for i in range(A,B+1)]
    # output process 1
    for i in range(K):
        if len(num_list)<=0:
            break
        n = num_list[0]
        print(n)
        num_list.remove(n)

    # output process 2
    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)]
    # output process 1
    for i in range(K):
        n = num_list_1[i]
        print(n)

    # output process 2
    for i in range(K):
        n = num_list_2[i]
        print(n)

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
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):
            #print("i",i)
            if i<a+k:
                        print(i)
            elif b-k<i:
                        print(i)
"""

Submission status: Accepted

Solution code:
#ABC093

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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())
            
ans=[]
            
for i in range(K):
  if A+i <=B:
    ans.append(A+i)
  if B-i >= A:
    ans.append(B-i)
            
            
ans = sorted(list(set(ans)))
print(*ans,sep="\n")

Submission status: Accepted

Solution code:
#093_B
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')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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


# for i in range(A, B+1):
#     hako.append(i)
# new = []
# new += hako[0:K]
# new += hako[B - K + 1::-1]

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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))
# print(" ".join(sortX))
for x in sortX:
    print(x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)]

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
answer = set([])
for i in range(A, min(A+K, B+1)):
    answer.add(i)
    # print(i)
for i in range(max(A, B-K+1), B+1):
    answer.add(i)
    # print(i)
# print(answer)
ordered_answer = sorted(answer)
# print(ordered_answer)
for i in ordered_answer:
    print(i)

Submission status: Accepted

Solution code:
a,b,k = map(int, input().split())
#print(l)
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')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#Small and Large Integers
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])

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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]

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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