Problem:
 Score : 200 points    Problem Statement Print all the integers that satisfies the following in ascending order:   Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.       Constraints  1 \leq A \leq B \leq 10^9  1 \leq K \leq 100  All values in input are integers.         Input Input is given from Standard Input in the following format:  A  B  K       Output Print all the integers that satisfies the condition above in ascending order.        Sample Input 1 3 8 2      Sample Output 1 3
4
7
8   3 is the first smallest integer among the integers between 3 and 8 .  4 is the second smallest integer among the integers between 3 and 8 .  7 is the second largest integer among the integers between 3 and 8 .  8 is the first largest integer among the integers between 3 and 8 .        Sample Input 2 4 8 3      Sample Output 2 4
5
6
7
8       Sample Input 3 2 9 100      Sample Output 3 2
3
4
5
6
7
8
9

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

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

k = k-1
i = a
while True:
    print(i)
    i += 1
    if  i > a + k or i > b:
        break
if i < b-k:
    i = b-k
while i <= b:
    print(i)
    i += 1

Solution (Python):
from typing import List


def answer(a: int, b: int, k: int) -> List[int]:
    a_k = set(range(a, min(a + k, b + 1)))
    k_b = set(range(max(b - k + 1, a + 1), b + 1))

    return sorted(a_k.union(k_b))


def main():
    a, b, k = map(int, input().split())
    for i in answer(a, b, k):
        print(i)


if __name__ == '__main__':
    main()

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

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

Solution (Python):
A,B,K = map(int,input().split())
if B - A >= 2 * K :
  for i in range(K):
    print(A + i)
  for j in reversed(range(K)):
    print(B - j)
else:
  for _ in range(A,B + 1):
    print(_)

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

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

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

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

Solution (Python):
lst = input().split()
A = int(lst[0])
B = int(lst[1])
K = int(lst[2])

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

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

Solution (Python):
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
a, b, k = [int(num) for num in lines.pop(0).split(" ")]
s1 = set(range(a, min(b, a + k)))
s2 = set(range(max(a, b - k + 1), b + 1))
lis = sorted(s1 | s2)
for i in lis:
    print(i)

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

Solution (Python):

import sys
input=sys.stdin.readline
import numpy as np

def main2():
    A,B,K=map(int,input().split())
    if A+K-1>=B-K+1:
        for i in range(A,B+1):
            print(i)
    else:
        for i in range(A,A+K):
            print(i)
        for i in range(B-K+1,B+1):
            print(i)

def main():
    numbers=[]
    a,b,k = map(int,input().split())
    numbers=np.arange(a,b+1)
    A=set(numbers[:k])
    B=set(numbers[-k:])
    answers = A|B
    
    for i in sorted(answers):
        print(i)

if __name__=="__main__":
    main2()

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

A1 = A
A2 = min(A+K,B+1)
for i in range(A1,A2):
  print(i)

B1 = max(B-K+1,A+K)
B2 = B+1  
for i in range(B1,B2):
  print(i)

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

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

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

for i in range(A,A+K):
    print(i)
    if i == B:
        falg = False
        break

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

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

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

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

ans=[]

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

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


for a in ans:
    print(a)

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

Solution (Python):
a,b,n=map(int,input().split())
Alist = list(range(a,min(a+n,b+1),1))
Blist = list(range(max(a,b-n+1),b+1,1))
C = sorted(set(Alist)|set(Blist))
for i in list(C):
  print(i)

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

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

for i in range(max(A, B - K + 1), B + 1):
    ans.add(i)
ans = sorted(list(ans))
for i in ans:
    print(i)

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

if B-A+1>2*K:
    for i in range(K):
        print(A+i)
    for j in range(K):
        print(B-K+j+1)
else:
    for k in range(B-A+1):
        print(A+k)

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

cnt=int(b-a+1)

if cnt<=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())

r = range(a, b + 1)
r = list(set(r[:k]) | set(r[-k:]))
r.sort()

for _r in r:
    print(_r)

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

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

if K>(B-A)/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 a+k+1 <= b:
    for i in range(a, k+a):
        print(i)
    if a+k+1 <= b+1-k:
        for i in range(b+1-k, b+1):
            print(i)
    else:
        for i in range(a+k, b+1):
            print(i)
else:
    for i in range(a, b+1):
        print(i)

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

Solution (Python):
a=input().split(' ')
A=int(a[0])
B=int(a[1])
K=int(a[2])
if B-A+1<=K*2:
  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):
a,b,k=map(int,input().split())
x=[]
y=[]
if b-a<k:
    k=b-a+1
for i in range(a,a+k):
    x.append(i)
for i in range(b-k+1,b+1):
    x.append(i)
x=list(set(x))
x.sort()
for i in range(len(x)):
    print(x[i])

Solution (Python):
A,B,K=map(int,input().split())
if A+K-1>=B-K+1:
    for i in range(A,B+1):
        print(i)
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())
n = []
for i in range(k):
    if a + i > b:
        break
    n.append(a + i)
for j in range(k):
    if b - k + 1 + j < a:
        break
    if n.count(b - k + 1 + j) <= 0:
        n.append(b - k + 1 + j)
[print(num) for num in n]

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

num = set()
for v in range(a, a + k):
    if v > b:
        break
    num.add(v)
    print(v)

for v in range(b + 1 - k, b + 1):
    if v < a:
        continue
    if v in num:
        continue
    print(v)

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

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

ls_1 = [i for i in range(A,min(A+K,B+1))]
ls_2 = [j for j in range(max(A,B-K+1),B+1) if j not in ls_1]
ls = ls_1 + ls_2

for ans in ls:
  print(ans)

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

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

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

ans=sorted(list(ans))

for i in (ans):
    print(i)

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

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

print(*ans, sep='\n')

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

for i in range(A, min(A + K, B + 1)):
    print(i)
for i in range(max(B - K + 1, A + K), B + 1):
    print(i)

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

upstart = max(B - K + 1, 0)
uplim = min(upstart + K, B)
ans = set([a for a in range(A, min(A + K, B))] + [b for b in range(upstart, uplim + 1)])
ans = sorted(list(ans))
for a in ans:
    if a < A:
        continue
    print(a)

Solution (Python):
from collections import OrderedDict

A, B, K = map(int, input().split())
L = []
res = []

if K > B-A:
    for i in range(A, B+1):
        print(i)
    exit()
else:
    for i in range(A, A+K):
        res.append(i)
    for i in range(B-K+1, B+1):
        res.append(i)

res_unique = list(set(res))
res_unique.sort()

for i in res_unique:
    print(i)

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

Solution (Python):
a, b, k = map(int, input().split())
x = list()
for i in range(k):
    if a+i<= b:
        print(a+i)
        x.append(a+i)
for j in range(k):
    f = b-k+j+1
    if a <= f and f <= b and f not in x:
        print(f)

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

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


if __name__ == "__main__":
    main()

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

for num in range(A, min(B+1, A+K)):
    print(num)
for num in range(max(A+K, B-K+1), B+1):
    print(num)

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    A,B,K=mi()
    ans = set()
    for i in range(A,A+K):
        if A<=i<=B:
            ans.add(i)
    
    for i in range(B-K+1,B+1):
        if A<=i<=B:
            ans.add(i)
    
    ans = list(ans)
    ans.sort()
    print(*ans,sep='\n')







if __name__ == "__main__":
    main()

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

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

else:
  a_set={i for i in range(a,a+k)}
  b_set={i for i in range(b-k+1,b+1)}

  ans_set = sorted(a_set | b_set)

  for i in ans_set:
    print(i)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    A, B, K = map(int, readline().split())
    s = set()

    for i in range(A, A + K):
        if i > B:
            break
        s.add(i)

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

    res = sorted(list(s))

    for x in res:
        print(x)


if __name__ == '__main__':
    main()

Solution (Python):
a,b,k=map(int, input().split())
k=min(k,b-a+1)
*al,=range(a,a+k)
*al2,=range(b-k+1,b+1)
ans=al+al2
ans=list(set(ans))
ans.sort()
for i in ans:print(i)

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

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

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

lim_1 = min(a + k, b)
lim_2 = max(b - k + 1, a)
ans = set(list(range(a, lim_1)) + list(range(lim_2, b + 1)))

for n in ans:
    print(n)

Solution (Python):
A, B, K = map(int, input().split())
SA = list(range(A, min(B, A + K)))
SB = list(range(max(A, B - K + 1), B + 1))

ans = sorted(set(SA + SB))
for a in ans:
    print(a)

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

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

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

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

num_limit = b-a+1
if num_limit <= k*2:
    ans_list = [i for i in range(a, b+1, 1)]
else:
    ans_list = []
    for j in range(k):
        low = a+j
        high = b-j
        ans_list.append(low)
        ans_list.append(high)
    ans_list.sort()

for l in ans_list:
    print(l)

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

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

for i in range(k):
    if a + i > b:
        break
    print(a + i)

start = max(a+k, b-k+1)

for i in range(start, b+1):
    print(i)

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

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

L = []
s = [i for i in range(A, min(A+K, B+1))]
l = [j for j in range(B, max(A-1, B-K), -1)]
L += s + l
L = list(set(L))
L.sort()

for i in L:
    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())
n = range(a, b+1)
for i in sorted(set(n[:k]) | set(n[-k:])):
  print(i)

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

if __name__ == "__main__":
    solve()

Solution (Python):
a, b, k = map(int, input().split())
res = set()
for i in range(a, a + k):
    res.add(min(b, i))

for i in range(b, b - k, -1):
    res.add(max(a, i))

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

Solution (Python):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    a, b, k = nm()

    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)


if __name__ == '__main__':
    main()

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

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

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

ans = set()
r = range(a, b + 1)
for i in range(min(k, len(r))):
    ans.add(r[i])
    ans.add(r[-i-1])
else:
    [print(i) for i in sorted(ans)]

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

Solution (Python):
a,b,k = map(int, input().split())
setA = set(i for i in range(a,min(a+k,b+1)))
setB = set(j for j in range(b,max(b-k,a-1),-1))
l = list(setA|setB)
l.sort()
for m in l:
  print(m)

Solution (Python):
n,m,k=map(int,input().split())
if(k>=m-n):
    for i in range(n,m+1):
        print(i)
else:
    l=list(range(n,n+k))
    d=list(range(m-k+1,m+1))
    s=l+d
    s=list(set(s))
    s.sort()
    for i in s:
        print(i)

Solution (Python):
A, B, K = map(int, input().split())
L = set()
for i in range(A, A+K):
  if i <= B:
    L.add(i)
for i in range(B, B-K, -1):
  if i >= A:
    L.add(i)
print(*sorted(list(L)), sep="\n")

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

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

Solution (Python):
a, b, k = map(int, input().split())
n = b - a + 1

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

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

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

Solution (Python):


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

ans = set([])

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

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

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

Solution (Python):
a, b, k = map(int, input().split())
ans = set()
for i in range(k):
    if a + i <= b:
        ans.add(a + i)
    if b - i >= a:
        ans.add(b - i)
for x in sorted(ans):
    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 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())

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

ans = []

for i in range(K):
  if A + i <= B and A + i not in ans:
    ans.append(A + i)
  
  if B - i >= A and B - i not in ans:
    ans.append(B - i)
    
ans.sort()

for i in ans:
  print(i)

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

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

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

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

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())
C=[]
D=[]
for i in range(K):
    if A+i<=B:
        C.append(A+i)
for i in range(K):
    if B-i>=A:
        D.append(B-i)
E=C+D
E.sort()
F=list(set(E))
F.sort()
for i in range(len(F)):
    print(F[i])

Solution (Python):
a, b, k = map(int, input().split())
r = range(a, b+1)

for i in (sorted(set(r[:k]) | set(r[-k:]))):
    print(i)

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

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

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

x = range(A,B+1)

for s in sorted(set(x[:K]) | set(x[-K:])):
	print(s)

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

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

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

lst=[]
for i in range(a,a+k):
    if i<=b:
        lst.append(i)

for i in range(b-k+1,b+1):
    if a<=i and not i in lst:
        lst.append(i)

print(*lst)

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

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

Solution (Python):

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

ans = []
for j in range(K):
    a = A+j
    b = B-j
    if a > B or b < A:
        break
    ans.append(a)
    ans.append(b)

ans = list(sorted(set(ans), reverse = False))

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



import math

def resolve():
    import sys
    input = sys.stdin.readline
    a, b, k = [int(x) for x in input().rstrip().split(" ")]

    if (b - a + 1)  <= k * 2:
        print("\n".join([str(num) for num in range(a, b+1)]))
    else:
        print("\n".join([str(num) for num in range(a, a+k)]))
        print("\n".join([str(num) for num in range(b-k+1, b+1)]))



if __name__ == "__main__":
    resolve()

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

ans = {}
for i in range(a,a+k):
    if i<=b:
        ans.setdefault(i,0)
        ans[i] += 1
    else:
        break
for i in range(b-(k-1),b+1):
    if a<=i:
        ans.setdefault(i,0)
        ans[i] += 1
    else:
        break
for i in ans.keys():
    print(i)

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

if K > (B - A) // 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())
c = 0
S = []
if B - A <= K:
    for i in range(A,B+1):
        print(i)
    exit()
for i in range(A,B+1):
    if c == K:
        break
    print(i)
    S.append(i)
    c += 1
for i in range(B-K+1,B+1):
    if i not in S:        
        print(i)

Solution (Python):
A, B, K = map(int, input().split())
r = range(A, B+1)

for s in sorted(set(r[:K]) | set(r[-K:])):
    print(s)

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

if (b-a+1) < k:
    for i in range(a,b+1):
        print(i)
else:  
    lst1 = [i for i in range(a,a+k)]
    lst2 = [i for i in range(b-k+1,b+1)]

    lst = sorted(list(set(lst1 + lst2)))

    for i in lst:
        print(i)

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

Solution (Python):
def main():
    a, b, k = map(int, input().split())
    printed = 0
    l = []
    for i in range(k):
        if a + i > b:
            return
        print(a + i)
        printed = a + i
        l.append(printed)
    if printed >= b:
        return
    for i in range(k):
        if b - k + 1 + i in l:
            continue
        elif b - k + 1 + i > b:
            break
        print(b - k + 1 + i)

main()

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

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

ans1 = [i for i in range(A, A + K) if A <= i and i <= B]
ans2 = [i for i in range(B, B - K, -1) if A <= i and i <= B]

ans = ans1 + ans2
ans = list(set(ans))
ans.sort()
for ans in ans:
    print(ans)

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

Solution (Python):
A,B,K=list(map(int, input().split()))
a=min(A+K-1,B)
b=max(A,B-K+1)
L=list(range(A,a+1)) + list(range(b,B+1))
L=list(set(L))
L.sort()
for _ in range(len(L)):
  print(L[_])

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

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

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

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

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


def read():
    A, B, K = list(map(int, input().strip().split()))
    return A, B, K


def solve(A, B, K):
    d = defaultdict(bool)
    for a in range(A, min(A+K, B+1)):
        d[a] = True
    for b in range(B, max(A-1, B-K), -1):
        d[b] = True
    ans = list(sorted(d.keys()))
    for a in ans:
        print(a)


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b, x = rm()
set_ = set()
for i in range(x):
    if a+i <= b:
        set_.add(a + i)
        set_.add(b - i)
li = sorted(list(set_))
for i in li:
    print(i)

Solution (Python):









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

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

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

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

Solution (Python):
A,B,K=map(int,input().split())
if B-A>200:
    k=range(A,A+K)
    l=range(B-K+1,B+1)
    for i in k:
        print(i)
    for i in l:
        print(i)
else:
    s=range(A,B+1)
    t=[x for x in s if A<=x<=A+K-1 or B-K+1<=x<=B]
    t.sort()
    for i in t:
        print(i)

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

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

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


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

a, b, k = inintm()

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

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

L = []

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

ans = sorted(set(L))

print(*ans, sep="\n")

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    if B - A + 1 < 2 * K:
        ans = list(range(A, B + 1))
    else:
        ans = list(range(A, A + K)) + list(range(B - K + 1, B + 1))

    print(*ans, sep='\n')

    return


if __name__ == '__main__':
    main()

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