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: Time Limit Exceeded

Solution code:
import math
import sys
from functools import reduce
input = sys.stdin.readline

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

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

main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
a,b,k = map(int,input().split())
for i in range(a,b+1):
    if a <= i <= a+k-1 or b-k+1 <= i <= b: print(i)

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
num=[i for i in range(a,b+1)]
ans=[]
ans.extend(num[:k])
ans.extend(num[-k:])
ans=sorted(list(set(ans)))
for ansi in ans:
    print(ansi)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())
print(*[i for i in range(A,B+1) if i<A+K or B-K<i],sep="\n")

Submission status: Time Limit Exceeded

Solution code:


import numpy as np

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
a,b,k = map(int,input().split())

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())
s = list(set(range(A,B+1))&(set(range(A,A+K))|set(range(B-K+1,B+1))))
for i in sorted(s):
  print(i)

Submission status: Time Limit Exceeded

Solution code:
import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial, ceil
sys.setrecursionlimit(200000)
input = sys.stdin.readline

# N, M, = map(int, input().split())
# N = int(input())
# L = [int(v) for v in input().split()]
# L = [[int(v) for v in input().split()] for _ in range(N)]
# L = [int(input()) for _ in range(N)]
# L = [list(input().strip())  for _ in range(N)]
# S = input().strip()

L = [int(v) for v in input().split()]

for v in range(L[0], L[1] + 1):
    if v <= L[0] + L[2] - 1 or v >= L[1] - L[2] + 1:
        print(v)

Submission status: Time Limit Exceeded

Solution code:
# -coding: utf-8 -

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

s = [i for i in range(a,b+1)]
add = "\n"
#print(s)

if len(s) < k*2:
    strs = [str(num) for num in s]
    k = add.join(strs)
else:
    s_left = s[:k]
    s_right = s[-k:]
    s2 = s_left+s_right
    strs = [str(num) for num in s2]
    k = add.join(strs)
print(k)

Submission status: Time Limit Exceeded

Solution code:
# -coding: utf-8 -

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

s = [i for i in range(a,b+1)]
#print(s)

if len(s) < k*2:
    for i in s:
        print(i)

if len(s) >= k*2:
    s_left = s[:k]
    s_right = s[-k:]
    s2 = s_left+s_right
    for i in s2:
        print(i)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
lst = [x for x in range(a, b + 1)]
lst_small = lst[:k]
lst_large = lst[-k:]
ans = list(set(lst_small) | set(lst_large))
ans = sorted(ans)
for i in range(len(ans)):
    print(ans[i])

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
lst = [x for x in range(a, b + 1)]
lst_small = lst[:k]
lst_large = lst[-k:]
ans = list(set(lst_small) | set(lst_large))
ans = sorted(ans)
for i in range(len(ans)):
    print(ans[i])

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
li = list(map(int,input().split()))
for i in range(li[0],li[1]+1):
    if i<=li[0]+li[2]-1 or i>=li[1]-li[2]+1:
        print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

l2=set(l[:k]+l[-k:])

print(" ".join(map(str, sorted(l2)) ))

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
ab = [i for i in range(a, b+1)]
if (b-a)//2 < k:
    ans = ab
else:
    ans = ab[0:k] + ab[len(ab)-k:len(ab)]
print(*ans)

Submission status: Time Limit Exceeded

Solution code:
import sys
a,b,k = map(int, sys.stdin.readline().split())

l = [x for x in range(a, b+1)]

left = set(l[:k])
right = set(l[-k:])

sum = left | right

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

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int,input().split())
li = [i for i in range(A,B + 1)]
ans = set(li[:K] + sorted(li,reverse = True)[:K])
  
for i in sorted(ans):
  print(i)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int,input().split())
li = [i for i in range(A,B + 1)]
ans = sorted(list(set(li[:K] + sorted(li,reverse = True)[:K])))

for i in ans:
  print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
ans = set()
n = [i for i in range(a,b+1)]
[ans.add(i) for i in n[:k]]
[ans.add(i) for i in n[-k:]]
ans = list(ans)
ans.sort()
[print(a) for a in ans]

Submission status: Time Limit Exceeded

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

for i in range(A , B + 1):
    C.append(i)


N = len(C)


if N > 2* K:
    for i in range(K):
        print(C[i])
    for j in range(K):
        print(C[j-K])
else:
    for i in C:
        print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
mn = a
mx = b
 
def in_range(a,b,n):
  return a <= n and b >= n
 
for i in range(a,b+1):
  if in_range(mn,mn+k-1,i) or in_range(mx-k+1,mx,i):
    print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
numalllist = [num for num in range(a, b + 1)]
if k >= len(numalllist) :
    for i in numalllist :
        print(i)
else :
    small = numalllist[:k]
    large = sorted(numalllist, reverse=True)[:k]
    anslist = sorted(list(set(small + large)))
    for i in anslist :
        print(i)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = [int(i) for i in input().split()]
print(*[i for i in range(a, b + 1) if i < a + k or b - k < i], sep="\n")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())
l = range(A, B+1)
  
for i in range(len(l)):
  if l[i] <= A + K - 1 or B - K + 1 <= l[i]:
    print(l[i])

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

num_list = [num for num in range(A, B+1)]
K_minus = - K
a = num_list[0:K]
b = num_list[K_minus:]
s = a + b
s = set(s)
s = sorted(s)
for num in s:
  print(num)

Submission status: Time Limit Exceeded

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

num_list = [num for num in range(A, B+1)]
K_minus = - K
if K > len(num_list):
  for num in num_list:
    print(num)
else:
  a = num_list[0:K]
  b = num_list[K_minus:]
  s = a + b
  s = set(s)
  s = sorted(s)
  for num in s:
    print(num)

Submission status: Time Limit Exceeded

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

num_list = [num for num in range(A, B+1)]
K_minus = - K
if K >= len(num_list):
  for num in num_list:
    print(num)
else:
  a = num_list[0:K]
  b = num_list[K_minus:]
  s = a + b
  s = set(s)
  s = sorted(s)
  for num in s:
    print(num)

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

a,b,k = inpl()
res = []
for i in range(a,b+1):
    if i < a+k or i > b-k:
        res.append(i)
res.sort()
print(*res)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

c=[i for i in range(a,b+1) if i<=(a+k-1) or i>=(b-k+1) ]

for j in c:
    print(j)

Submission status: Time Limit Exceeded

Solution code:
# A,B,K = map(int, open(0).read().split())
A,B,K = map(int, input().split())
intList = [i for i in range(A,B+1)]
ansList = set(intList[:K]+intList[::-1][:K])
# print(intList)
# print(ansList)
for j in sorted(ansList):
    print(j)

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int, open(0).read().split())
intList = [i for i in range(A,B+1)]
ansList = set(intList[:K]+intList[::-1][:K])
# print(intList)
# print(ansList)
for j in sorted(ansList):
    print(j)

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int,input().split())
l=[x for x in range(A,B+1) if x-A<=K-1 or B-x<=K-1]
for x in l:
    print(x)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
S=[]
for i in range(a,b+1):
    S.append(i)
T=sorted(list(set(S[:k]+S[-k:])))

for i in T:
    print(i)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
ans = []
for i in range(a,b+1):
    if i < a + k or b - k < i:
        ans.append(i)
for i in range(len(ans)):
    print(ans[i])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
result_list = [i for i in range(a, b+1) if (i < a+k) or (i > b-k)]

for res in result_list:
  print(res)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
print(*[i for i in range(a, b+1) if (i < a+k) or (i > b-k)], sep = '\n')

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())
big = [i for i in range(A, B+1)]
big.sort(reverse=True)
small = [i for i in range(A, B+1)]

ans = []

ans += small[:K]
ans += big[:K]

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

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
l=[i for i in range(a,b+1)]
#print(l)
s=[]
for i in range(len(l)):
    if i<=k-1 or len(l)-k<=i:
        print(l[i])

Submission status: Time Limit Exceeded

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

AB = range(A,B+1)

tail = len(AB)
for i in range(tail):
    if i < K or tail - K <= i:
        print(AB[i])

Submission status: Time Limit Exceeded

Solution code:
A,B,K = [int(x) for x in input().split()]
c = [i for i in range(A,B+1)]
d = c[:K]
d+=c[-K:]
d = list(set(d))
d.sort()
print(*d)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())
s = set()
for i, n in enumerate(range(A, B+1)):
    if i+1 <= K:
        s.add(n)
for i, n in enumerate(reversed(range(A, B+1))):
    if i+1 <= K:
        s.add(n)
for i in sorted(s):
    print(i)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

if len(l) <= 2*k:
    print('\n'.join(map(str,l)))
else:
    print('\n'.join(map(str, l[:k])))
    print('\n'.join(map(str, l[len(l)-k:])))

Submission status: Time Limit Exceeded

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

for i in l[:k]:
    print(i)
for j in l[len(l)-k:]:
    if j <= i:
        continue
    print(j)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
import sys
a,b,k = map(int,input().split())
for i in range(b-a+1):
    if i < k or b-a-i < k:
        print(a+i)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = list(map(int, input().split()))
l = [i for i in range(a, b + 1) if (i < a + k) or (i > b - k)]
for i in l:
    print(i)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
List = [x for x in range(a,b+1) if x <= a+k-1 or x >= b-k+1]
for x in List: print(x)

Submission status: Time Limit Exceeded

Solution code:
# ABC093 B - Small and Large Integers
a,b,k = map(int, input().split())

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

Submission status: Time Limit Exceeded

Solution code:
# ABC093 B - Small and Large Integers
a,b,k = map(int, input().split())
s = set()
L = []
for i in range(a,b+1):
    if i <= a+k-1:
        s.add(i)
        continue
    elif i >= b-k+1:
        s.add(i)
        continue
L = list(s)
L.sort()

for l in L:
    print(l)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())
ab = [i for i in range(A,B+1)]
if A-B > 200:
    for x in (ab[:K] + ab[-K:]):
        print(x)
else:
    for x in sorted(list(set(ab[:K] + ab[-K:]))):
        print(x)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

l = []

for i in range(A, B+1, 1):
    l.append(i)


for i in range(len(l)):
    if i <= (K-1) or i >= (len(l)-K):
        print(l[i])

Submission status: Time Limit Exceeded

Solution code:
A, B, K = list(map(int, input().split()))
X = [x for x in range(A, B+1)]
sorted_ans = list(sorted(set(X[:K] + X[-K:])))
for x in sorted_ans:
    print(x)

Submission status: Time Limit Exceeded

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

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

    if i <= A+K-1:
        print(i)
    elif i>=B-K+1:
        print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

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())
L = [x for x in range(A, B + 1)]
X = L[:K] + L[len(L) - K::]
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)

Submission status: Time Limit Exceeded

Solution code:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

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())
L = [x for x in range(A, B + 1)]
X = L[:K] + L[len(L) - K::]
for x in sorted(list(set(X))):
    print(x)

Submission status: Time Limit Exceeded

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

tmp=[i for i in range(a,b+1)]
ans=[]
for a in tmp[:k]:
  ans.append(a)
for a in tmp[-k:]:
  ans.append(a)
out=list(set(ans))
out.sort()
print(*out,sep='\n')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
l=[]
for i in range(a,b+1):
	if min(i-a,b-i)<k:
		l.append(i)
print(*l,sep='\n')

Submission status: Time Limit Exceeded

Solution code:
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)&set(range(a,b+1)))
print(*u,sep="\n")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
src = [i for i in range(a,b+1)]
re = sorted(src, reverse=True)
if k > len(src):
    k = len(src)
li = set()
for ki in range(k):
    li.add(src[ki])
    li.add(re[ki])
for l in sorted(li):
    print(l)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
src = [i for i in range(a,b+1)]
re = sorted(src, reverse=True)
if k > len(src):
    k = len(src)
li = []
for ki in range(k):
    li.append(src[ki])
    li.append(re[ki])
for l in sorted(set(li)):
    print(l)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
src = [i for i in range(a,b+1)]
if k > len(src):
    k = len(src)
li = []
for ki in range(k):
    li.append(src[ki])
for ki in reversed(range(k)):
    li.append(src[-(ki+1)])
for l in sorted(set(li)):
    print(l)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
src = [i for i in range(a,b+1)]
if k > len(src):
    k = len(src)
li = set()
for ki in range(k):
    li.add(src[ki])
for ki in reversed(range(k)):
    li.add(src[-(ki+1)])
for l in sorted(li):
    print(l)

Submission status: Time Limit Exceeded

Solution code:
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
for i in range(a, b+1):
    if i <= a + k - 1 or i >= b - k + 1:
        print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
list = list(l for l in range(a,b+1))
if b-a+1 < k*2:
  for i in range(a,b+1):
    print(i,end="\n")
else:
  for j in range(k):
    print(list[j],end="\n")
  for k in range(k-1,-1,-1):
    if k==0:
      k = -1
      print(list[k],end="\n")
    else:
      k = k*(-1)-1
      print(list[k],end="\n")

Submission status: Time Limit Exceeded

Solution code:

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

Submission status: Time Limit Exceeded

Solution code:
a,b,k = [int(i) for i in input().split()]
jougen = a+k-1
kagen = b-k+1
for i in range(a,b+1):
  if i<=jougen or kagen<=i:
    print(i)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = [int(i) for i in input().split()]
 
for i in range(a,b+1):
  if abs(a-i)<k or abs(b-i)<k:
    print(i)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
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))
#ans.sort()

'''
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]

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

[print(i) for i in ans]

Submission status: Time Limit Exceeded

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

for i in ans:
  print(i)

Submission status: Time Limit Exceeded

Solution code:
# ABC93, B - small and large integers
a, b, k = map(int, input().split(' '))

X = [i for i in range(a, b+1)]

if k >= len(X)/2:
    [print(x) for x in X]
else:
    for i in range(k):
        print(X[i])
    for i in range(k, 0, -1):
        print(X[len(X)-i])

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())
num = A
while num <= B:
  if num <= A+K-1 or num >= B-K+1:
    print(num)
  num += 1

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!

A, B, K = map(int, input().split())
s = [_ for _ in range(A, B + 1)]
s_len = len(s)

if K * 2 >= s_len:
    for i in s: print(i)
else:
    for j in range(K): 
        print(s[j])
    for k in range(s_len - K, s_len): 
        print(s[k])

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!

A, B, K = map(int, input().split())
s = [_ for _ in range(A, B + 1)]
s_len = len(s)

if K * 2 >= s_len:
    for i in s: print(i)
else:
    for j in range(K):
        print(s[j])
    for k in range(s_len - K, s_len):
        print(s[k])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())
ab = [int(i) for i in range(A, B + 1)]
ba = ab[::-1]
ans = set()

for i in range(min(K, len(ab))):
    ans.add(ab[i])
    ans.add(ba[i])

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

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())
ab = [int(i) for i in range(A, B + 1)]
ba = sorted(ab, reverse=True)
ans = []

for i in range(min(K, len(ab))):
    ans.append(ab[i])
    ans.append(ba[i])

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

nums=[i for i in range(a,b+1)]
nums2=sorted(nums,reverse=True)

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

else:
    ans=[]
    for i in range(k):
        ans.append(nums[i])
        ans.append(nums2[i])
    ans=sorted(ans)
    for j in ans:
        print(j)