Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

n = int(input())
for m in range(n):
    count = 0
    for i in range(n):
        x = i + 1
        xx = x * x
        if  x * x >= n:
            break
        for j in range(n):
            y = j + 1
            yy = y * y
            if xx + yy + x * y>= n:
                break
            for k in range(n):
                z = k + 1
                zz = z * z
                if xx + yy + zz + x * y + y * z + z * x > m+1:
                    break
                elif xx + yy + zz + x * y + y * z + z * x == m+1:
                    count += 1
                    break
    print(count)



### FIXED CODE ###

n = int(input())
ans = [0] * n
count = 0
for i in range(n):
    x = i + 1
    xx = x * x
    if  x * x >= n:
        break
    for j in range(n):
        y = j + 1
        yy = y * y
        if xx + yy + x * y>= n:
            break
        for k in range(n):
            z = k + 1
            zz = z * z
            kotae = xx + yy + zz + x * y + y * z + z * x
            if kotae > n:
                break
            ans[kotae-1] += 1
for i in range(n):
    print(ans[i])
### BUGGY CODE ###

while 1:
    n=int(input())
    if not n:break
    l=tuple([int(input()) for _ in range(n)])
    print(max(sum(l[j:i]) for i in range(len(l)+1) for j in range(i)))



### FIXED CODE ###

while 1:
    n=int(input())
    if not n:break
    dp=[0 for _ in range(n)]
    dp[0]=int(input())
    for i in range(1,n):
        v=int(input())
        dp[i]=max(dp[i-1]+v,v)
    print(max(dp))
### BUGGY CODE ###

N, K = map(int, input().split())
*V, = map(int, input().split())
A = [0]*(N+1)
B = [0]*(N+1)
MASK = 2**(K+1)-1
A[0] = 1
for i in range(N):
    if K <= V[i]:
        A[i+1] = A[i]
    else:
        A[i+1] = (A[i] | (A[i] << V[i])) & MASK
B[N] = 1 << K
for i in range(N-1, -1, -1):
    if K <= V[i]:
        B[i] = B[i+1]
    else:
        B[i] = (B[i+1] | (B[i+1] >> V[i])) & MASK

ans = N
for i in range(N):
    a = A[i]; b = B[i+1]
    t = K
    K0 = K-V[i]
    for s in range(K+1):
        if a & 1 == 0:
            a >>= 1
            if not a: break
            continue
        while t > -1 and (s + t >= K or b & 1 == 0):
            t -= 1
            b >>= 1
        if not b: break
        if K0 <= s + t:
            ans -= 1
            break
        a >>= 1
print(ans)


### FIXED CODE ###

import random
N, K = map(int, input().split())
*V, = map(int, input().split())
A = [0]*(N+1)
B = [0]*(N+1)
MASK = 2**(K+1)-1
A[0] = 1
for i in range(N):
    if K <= V[i]:
        A[i+1] = A[i]
    else:
        A[i+1] = (A[i] | ((A[i] << V[i]) & MASK))
B[N] = 1 << K
for i in range(N-1, -1, -1):
    if K <= V[i]:
        B[i] = B[i+1]
    else:
        B[i] = (B[i+1] | (B[i+1] >> V[i]))

ans = N
for i in range(N):
    if K <= V[i]:
        ans -= 1
        continue
    a = A[i]; b = B[i+1]
    VM = 2**(V[i]+1)-2
    l = 1
    while a and b and l:
        if a & 1 and b & VM:
            ans -= 1
            break
        l = max((a & -a).bit_length()-1, (b & -b).bit_length()-V[i]-1)
        a >>= l; b >>= l
print(ans)
### BUGGY CODE ###

n_m = input().split(' ')
n = int(n_m[0])
m = int(n_m[1])
field = []
for i in range(n):
    field.append([0]*n)

h = input().split(' ')

for m_ in range(m):
    x_y = input().split(' ')
    x = int(x_y[0])-1
    y = int(x_y[1])-1
    field[x][y] = 1
    field[y][x] = 1

count = 0
for i in range(n):
    c = 0
    for fi in range(len(field[i])):
        if field[i][fi] == 1:
            if h[i] > h[fi]:
                c += 1
            elif h[i] <= h[fi]:
                break
    if c == sum(field[i]):
        count += 1
print(count)


### FIXED CODE ###

n_m = input().split(' ')
n = int(n_m[0])
m = int(n_m[1])

field = [0]*n

h = input().split(' ')

for m_ in range(m):
    x_y = input().split(' ')
    x = int(x_y[0])-1
    y = int(x_y[1])-1
    if float(h[x]) > float(h[y]):
        field[y] += 1
    elif float(h[x]) < float(h[y]):
        field[x] += 1
    elif float(h[x]) == float(h[y]):
        field[x] += 1
        field[y] += 1
count = 0
for f in field:
    if f == 0:
        count+=1
print(count)
### BUGGY CODE ###

Q = int(input())
memo = [0]*(10**5+1)
def eratos2():
    primes = []
    for i in range(2, 10**4):
        flag = True
        for p in primes:
            if i%p == 0:
                flag = False
        if flag:
            primes.append(i)
    return primes
D = eratos2()

for i in range(1, 10**5+1):
    if i in D and (i+1)//2 in D:
        memo[i] = memo[i-1] + 1
    else:
        memo[i] = memo[i-1]

for _ in range(Q):
    l, r = map(int, input().split())
    print(memo[r+1]-memo[l-1])

### FIXED CODE ###

Q = int(input())
memo = [0]*(10**5+1)

def is_prime(N):
    prime = [True for _ in range(N)]
    prime[1] = False
    for i in range(2, N):
        if not prime[i]:
            continue
        j = i+i
        while j<N:
            prime[j] = False
            j += i
    return prime

prime = is_prime(10**5+1)

for i in range(1, 10**5+1):
    if prime[i] and prime[(i+1)//2]:
        memo[i] = memo[i-1] + 1
    else:
        memo[i] = memo[i-1]

for _ in range(Q):
    l, r = map(int, input().split())
    print(memo[r+1]-memo[l-1])
### BUGGY CODE ###

import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1
 
n, k = map(int, input().split())
A = list(map(int, input().split()))
for i in range(k-1, n):
    #print(A[i])
    if i == k-1:
        now = 1
        for j in range(k):
            now *= A[i-j]
        before = now
    else:
        now = now//A[i-k]
        now *= A[i]
        #print(A[i-k], A[i], now, before)
        if before < now:
            print("Yes")
        else:
            print("No")
        before = now

### FIXED CODE ###

import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1
 
n, k = map(int, input().split())
A = list(map(int, input().split()))
for i in range(k-1, n):
    if i == k-1:
        continue
    else:
        if A[i] > A[i-k]:
            print("Yes")
        else:
            print("No")
        #print(A[i], A[i-k])
### BUGGY CODE ###

import sys
def input(): return sys.stdin.readline().rstrip()


def main():
    n, m = map(int, input().split())
    price = [0]*m
    typesnum = [0]*m
    types = [[] for _ in range(m)]
    for i in range(m):
        price[i], typesnum[i] = map(int, input().split())
        types[i] = list(map(lambda x: int(x)-1, input().split()))
    dp = [10**9]*(1 << n)
    dp[0]=0
    for bit in range(1 << n):
        for i in range(m):
            keybit = 0
            for op in types[i]:
                keybit |= 1 << op
            dp[bit | keybit] = min(dp[bit | keybit], dp[bit]+price[i])
    if dp[-1] == 10**9:
        dp[-1] = -1
    print(dp[-1])


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().rstrip()


def main():
    n, m = map(int, input().split())
    price = [0]*m
    typesnum = [0]*m
    types = [[] for _ in range(m)]
    for i in range(m):
        price[i], typesnum[i] = map(int, input().split())
        types[i] = list(map(lambda x: int(x)-1, input().split()))
    dp = [10**9]*(1 << n)
    dp[0]=0
    for bit in range(1 << n):
        for i in range(m):
            keybit = 0
            for op in types[i]:
                keybit |= 1 << op
            dp[bit | keybit] = min(dp[bit | keybit], dp[bit]+price[i])
    if dp[-1] == 10**9:
        dp[-1] = -1
    print(dp[-1])


if __name__ == '__main__':
    main()
### BUGGY CODE ###

import sys
import copy
def input():
    return sys.stdin.readline()
n = int(input())
a = [int(i) for i in input().split()]

def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i:
        divisors.append(n//i)

  # divisors.sort()
  return divisors

ans = []
tmp = []
for i,x in enumerate(reversed(a)):
  y = n-i
  if x:
    ans.append(y)
    tmp = make_divisors(y)
    for j in tmp:
      a[j-1] ^= 1
      #print(a)
print(len(ans))
for i in reversed(ans):
  print(i,end=' ')

### FIXED CODE ###

import sys
import copy
def input():
    return sys.stdin.readline()
n = int(input())
a = [int(i) for i in input().split()]

def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i:
        divisors.append(n//i)

  # divisors.sort()
  return divisors

ans = []
tmp = []
for i,x in enumerate(reversed(a)):
  y = n-i
  if x:
    ans.append(y)
    tmp = make_divisors(y)
    for j in tmp:
      a[j-1] ^= 1
      #print(a)
print(len(ans))
for i in reversed(ans):
  print(i,end=' ')
### BUGGY CODE ###

import sys
from operator import itemgetter

input = sys.stdin.readline

tl=200100

ft=[0]*tl

def upd(i):
	global ft
	i+=1
	while(i<tl):
		ft[i]+=1
		i+=i&-i

def get(i):
	global ft
	i+=1
	ret=0
	while(i!=0):
	    ret+=ft[i]
	    i-=i&-i
	return ret

md = 998244353
n = int(input())

xy = [[None]*2 for _ in range(n)]
yi = [[None]*2 for _ in range(n)]
for i in range(n):
	xy[i] = [int(item) for item in input().split()]
xy.sort(key=itemgetter(0))

for i in range(n):
	yi[i]=[xy[i][1],i]
yi.sort(key=itemgetter(0))

cnt=[0]*(n+1)
cnt[0]=1
for i in range(1,n+1):
	cnt[i]=cnt[i-1]*2%md

def comb(x):
	return cnt[x]-1;

ans=0

for aa in yi:
	ix=aa[1]
	a=get(ix)
	b=get(n)-get(ix)
	c=ix-a
	d=n-ix-1-b
	exc=(comb(a+b)+comb(a+c)+comb(b+d)+comb(c+d)-comb(a)-comb(b)-comb(c)-comb(d))%md
	cur=(comb(n)-exc)%md
	ans=(ans+cur)%md
	upd(ix)

if(ans<0):ans+=md

print(ans)


### FIXED CODE ###

import sys
import array

from operator import itemgetter

def main():



	input = sys.stdin.readline


	md = 998244353
	n = int(input())
	tl=n+1
	
	ft=[0]*tl

	xy = [[0]*2 for _ in range(n)]
	for i in range(n):
		xy[i] = [int(item) for item in input().split()]
	xy.sort(key=itemgetter(0))
	yxi = [y for x, y in xy]

	*YS, = set(yxi)
	YS.sort()
	yxi= list(map({e: i for i, e in enumerate(YS)}.__getitem__, yxi))

	ct=[0]*(n+1)
	ct[0]=1
	for i in range(1,n+1):
		ct[i]=ct[i-1]*2%md

	cnt=tuple(ct)

	def upd(i):
		i+=1
		while(i<=n):
			ft[i]+=1
			i+=i&-i

	def get(i):
		i+=1
		ret=0
		while(i!=0):
		    ret+=ft[i]
		    i-=i&-i
		return ret

	def calc(get,upd):
		for i, y in enumerate(yxi):
			v = get(y); upd(y)
			p1 = cnt[v]; p0 = cnt[y - v]
			q1 = cnt[i - v]; q0 = cnt[(n - y - 1) - (i - v)]
			yield (p0 + p1 + q0 + q1 - (p0 + q1) * (p1 + q0)) % md


	print((sum(calc(get,upd))+n*cnt[n] - n)%md)

main()
### BUGGY CODE ###

import sys
N = int(input())
A_list = list(map(int ,input().split()))

s = 1


for i in range(len(A_list)):
        s = s*A_list[i]
        if A_list[i] == 0:
            print("0")
            sys.exit()
if s>pow(10,18):
        print("-1")
else:
        print(s)

### FIXED CODE ###

import sys
N = int(input())
A_list = list(map(int ,input().split()))

s = 1

A_list.sort()
if A_list[0]==0:
    print("0")
    sys.exit()
for i in range(len(A_list)):
        s = s*A_list[i]
        if s>pow(10,18):
            print("-1")
            sys.exit()

print(s)
### BUGGY CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))

cnt = 0
for i in range(M):
	semi = True
	for j in A:
		if ((i+1) * 2 / j) % 2 != 1:
			semi = False
			break
	if semi:
		cnt += 1

print(cnt)

### FIXED CODE ###

N, M = map(int, input().split())
A = set(i//2 for i in map(int, input().split()))
B = []
for i in A:
	B = B + [0]
	while i % 2 == 0:
		i //= 2
		B[-1] += 1
if len(set(B)) == 1:
	m = max(A)
	A.remove(m)
	base = 0
	for i in range(m,M+1,2*m):
		semi = True
		for j in A:
			if i % j != 0 or (i // j) % 2 == 0:
				semi = False
				break
		if semi:
			base = i
			break
	if base == 0:
		print(0)
	else:
		print(((M // base) + 1)//2)
else:
	print(0)
### BUGGY CODE ###

from bisect import bisect_left as bl

N, Q = map(int, input().split())
ans = 0
q1 = []
q2 = []
query = []
for _ in range(Q):
    n, p = map(int, input().split())
    query.append((n, p))
    if n == 1:
        q1.append(p)
    else:
        q2.append(p)
q1s = sorted(q1)
q2s = sorted(q2)
board = [N - 2, N - 2]
for n, p in query:
    if n == 1:
        if p > board[1] + 1:
            continue
        index = bl(q1s, p)
        ans += board[0] * (len(q1s) - index)
        board[1] = p - 2
        q1s = q1s[:index]
    else:
        if p > board[0] + 1:
            continue
        index = bl(q2s, p)
        ans += board[1] * (len(q2s) - index)
        board[0] = p - 2
        q2s = q2s[:index]
print((N - 2) ** 2 - ans)

### FIXED CODE ###

from bisect import bisect_left as bl

N, Q = map(int, input().split())
ans = 0
q1 = []
q2 = []
query = []
for _ in range(Q):
    n, p = map(int, input().split())
    query.append((n, p))
    if n == 1:
        q1.append(p)
    else:
        q2.append(p)
q1.sort()
q2.sort()
board = [N - 2, N - 2]
count1 = len(q1)
count2 = len(q2)
for n, p in query:
    if n == 1:
        if p > board[1] + 1:
            continue
        index = bl(q1, p)
        ans += board[0] * (count1 - index)
        board[1] = p - 2
        count1 = index
    else:
        if p > board[0] + 1:
            continue
        index = bl(q2, p)
        ans += board[1] * (count2 - index)
        board[0] = p - 2
        count2 = index
print((N - 2) ** 2 - ans)
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))

ans = 0

for i in range(N):
    for j in range(i+1, N):
        ans += A[i] ^ A[j]

print(ans % (10**9 + 7))


### FIXED CODE ###

import math

N = int(input())
A = list(map(int, input().split()))

ans = 0
fil = 1
for i in range(60):
    num1 = len([1 for j in range(N) if A[j] & fil])
    num0 = N - num1
    ans += (num1 * num0) * fil
    fil <<= 1

print(ans % (10 ** 9 + 7))
### BUGGY CODE ###


def Attention():
    N = int(input())
    S = input()
    ans = 300000

    for i in range(N):
        count = S[:i-1].count('W') + S[i+1:].count('E')

        ans = min(ans, count)
    print(ans)

Attention()


### FIXED CODE ###


def Attention():
    N = int(input())
    S = input()
    ans = 300000

    Wcount = [0]
    Ecount = [0]
    cnt = 0
    for i in range(N):
        if S[i] == 'W':
            cnt += 1
        Wcount.append(cnt)
    cnt = 0
    for i in range(N):
        if S[(i + 1) * -1] == 'E':
            cnt += 1
        Ecount.append(cnt)

    for i in range(N):
        cnt = Wcount[i] + Ecount[(i + 2) * -1]
        ans = min(cnt, ans)
    print(ans)

Attention()
### BUGGY CODE ###

n = int(input())
A = list(map(int,input().split()))

B = []

for i in range(n):
  if i %2:
    B = [A[i]] + B
  else:
    B.append(A[i])
    
if n%2:
  B = B[::-1]
print(*B)

### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
from collections import deque

B = deque([])

for i in range(n):
  if i %2:
    B.appendleft(A[i])
  else:
    B.append(A[i])
B = list(B)
if n%2:
  B = B[::-1]
print(*B)
### BUGGY CODE ###

n = int(input())
s = input()
result = 0
r = g = b = []

for x in range(n):
  if s[x]=='R':
    r.append(x)
  if s[x]=='G':
    g.append(x)
  if s[x]=='B':
    b.append(x)

for i in r:
  si = s[i]
  for j in g:
    sj = s[j]
    if i>j or sj==si:
      continue
    for k in b:
      sk = s[k]
      if j>k or sk==si or sk==sj:
        continue
      if j-i != k-j:
        result += 1

print(result)

### FIXED CODE ###

import math

n = int(input())
s = input()
ex = 0

for i in range(n-2):
  for x in range(1, int(math.ceil((n-i)/2))):
    if s[i] != s[i+x] and s[i] != s[i+2*x] and s[i+x] != s[i+2*x]:
      ex += 1

print(s.count("R") * s.count("G") * s.count("B")-ex)
### BUGGY CODE ###

from collections import deque
import copy
H, W = map(int, input().split())
maze = [list(input()) for i in range(H)]
S = []
for i in range(H):
  for j in range(W):
    if maze[i][j] == ".":
      maze[i][j] = float("inf")
      S.append([i, j])
    else:
      maze[i][j] = -1
def bfs(H, W, maze, S):
  ans = 0
  for sy, sx in S:
    maze1 = copy.deepcopy(maze)
    maze1[sy][sx] = 0
    q = deque()
    q.append([sy,sx])
    while len(q)>0:
      y, x = q.popleft()
      for i, j in [[0, 1], [1, 0], [0, -1], [-1, 0]]:
        nexty = y+i
        nextx = x+j
        if nexty < 0 or nexty>=H or nextx < 0 or nextx>=W:
          continue
        dist = maze1[nexty][nextx]
        if maze1[nexty][nextx] != -1:
          if dist > maze1[y][x]:
            maze1[nexty][nextx] = maze1[y][x] + 1
            q.append([nexty, nextx])
    for i in range(len(maze1)):
      ans1 = max(maze1[i])
      ans = max(ans, ans1)
  print(ans)
bfs(H, W, maze, S)

### FIXED CODE ###

from collections import deque
import copy
def bfs():
    h,w = map(int, input().split())
    maze = [list(input()) for i in range(h)]
    S, G = [], []
    for y in range(h):
        for x in range(w):
            if maze[y][x]=='.':
                S.append([y,x])
                G.append([y,x])
                maze[y][x]=float("inf")
            else:
                maze[y][x]=-1
    l = []
    ans = 0
    for i in range(len(S)):
        maze1 = copy.deepcopy(maze)
        maze1[S[i][0]][S[i][1]]=0
        que=deque([[S[i][0],S[i][1]]])
        while que:
          y,x=que.popleft()
          for k,m in [(1,0),(0,1),(-1,0),(0,-1)]:
            nexty,nextx=y+k,x+m
            if nexty < 0 or nexty >= h or nextx < 0 or nextx >= w:
                continue
            dist=maze1[nexty][nextx]
            if dist!=-1:
              if dist>maze1[y][x]+1:
                maze1[nexty][nextx]=maze1[y][x]+1
                que.append([nexty,nextx])
            ans = max(ans, maze1[nexty][nextx])
    print(ans)
bfs()
### BUGGY CODE ###

from collections import deque
N,M = map(int,input().split())
graph = []
fship = []
for i in range(M):
    x,y = map(int,input().split())
    if x>y:
        x,y = y,x
    if [x-1,y-1] not in fship:
        fship.append([x-1,y-1])
fship.sort(key = lambda x: x[0])
graph = [[] for _ in range(N)]
for i in fship:
    graph[i[0]].append(i[1])

dist = [None]*N
ans = -1

for i in range(N):
    if dist[i]:
        continue
    dist[i] = True
    tmp = 0
    d = deque()
    d.append(i)
    while d:
        v = d.popleft()
        for i in graph[v]:
            if dist[i]:
                continue
            dist[i] = True
            d.append(i)
            tmp += 1
    ans = max(ans,tmp)
print(ans+1)

### FIXED CODE ###

from collections import deque
N,M = map(int,input().split())
graph = [[] for _ in range(N)]
for i in range(M):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    graph[x].append(y)
    graph[y].append(x)

seen = [None]*N
ans = -1

for i in range(N):
    if seen[i]:
        continue
    seen[i] = True
    tmp = 0
    d = deque()
    d.append(i)
    while d:
        v = d.popleft()
        for i in graph[v]:
            if seen[i]:
                continue
            seen[i] = True
            d.append(i)
            tmp += 1
    ans = max(ans,tmp)
print(ans+1)
### BUGGY CODE ###

from itertools import accumulate

N, K, *PC = map(int, open(0).read().split())
P, C = [0] + PC[:N], [0] + PC[N:]

ans = float("-inf")
for start in range(1, N + 1):
    path = []

    cur = P[start]
    path = [C[start]]
    while cur != start:
        path.append(C[cur])
        cur = P[cur]

    A = list(accumulate(path))
    q, r = divmod(K, len(path))
    res = 0
    if A[-1] >= 0:
        if r == 0:
            q -= 1
            r += len(path)
        res += A[-1] * q
    elif q >= 1:
        r = len(path)

    ans = max(ans, res + max(A[:r]))

print(ans)

### FIXED CODE ###

from itertools import accumulate

N, K, *PC = map(int, open(0).read().split())
P, C = [0] + PC[:N], [0] + PC[N:]

ans = float("-inf")
for start in range(1, N + 1):
    path = []

    cur = P[start]
    path = [C[start]]
    while cur != start:
        path.append(C[cur])
        cur = P[cur]

    A = list(accumulate(path))
    q, r = divmod(K, len(path))
    res = 0
    if A[-1] >= 0:
        if r == 0:
            q -= 1
            r += len(path)
        res += A[-1] * q
    elif q >= 1:
        r = len(path)

    ans = max(ans, res + max(A[:r]))

print(ans)
### BUGGY CODE ###

N = int(input())
nu = [int(x) for x in input().split()]
r2 = {}

for i in nu:
  r2[i] = nu.index(i)
#print(r2)

kyt = ""
for ky in r2.values():
  ky = str(ky +1)
  kyt = kyt + ky + " "
print(kyt)

### FIXED CODE ###

n1 = int(input())
l1 = [int(x) for x in input().split()]
l2 = [""] * n1

for i, v in enumerate(l1):
  l2[v -1] = i + 1

l2 = map(str,l2)
ans = " ".join(l2)
print(ans)
### BUGGY 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])

### FIXED CODE ###

# coding: utf-8
# Your code here!

A, B, K = map(int, input().split())
a1 = [_ for _ in range(A, min(A + K, B + 1))]
a2 = [_ for _ in range(max(A, B - K + 1), B + 1)]
s = sorted(set(a1 + a2))

for i in s: print(i)
### BUGGY CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N,M = [int(x) for x in input().split()]
ABdict = {}
for _ in range (N):
    A,B = [int(x) for x in input().split()]
    if A in ABdict.keys():
        ABdict[A] += B
    else:
        ABdict[A] = B

dct = sorted(ABdict.items())
ls = []
for pricenumber in dct:
    for i in range (pricenumber[1]):
        ls.append(pricenumber[0])

print(sum(ls[:M]))

### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N,M = [int(x) for x in input().split()]
ABdict = {}
for _ in range (N):
    A,B = [int(x) for x in input().split()]
    if A in ABdict.keys():
        ABdict[A] += B
    else:
        ABdict[A] = B

dct = sorted(ABdict.items())
ls = []
ans = 0
for i in dct:
    if M >= 0:
        ans += min(M,i[1])*i[0]    
        M -= i[1]  

print(ans)
### BUGGY CODE ###


N = int(input())
L = list(map(int, input().split()))


x = 0

for i in range(len(L)):
    for j in range(i+1, len(L)):
        for k in range(j+1, len(L)):
            if (L[i] < L[j] + L[k]):
                if (L[j] < L[k] + L[i]):
                    if  (L[k] < L[i] + L[j]):
                        x += 1
        
print(x)

### FIXED CODE ###

import bisect

n = int(input())
l = list(map(int, input().split()))
l = sorted(l)

cnt = 0
for i in range(n-1):
    for j in range(i+1,n):
        up = l[j] + l[i]
        #l[k] = up となるようなkのうち最小のものを見つけろ
        k = bisect.bisect_left(l, up)
        cnt += k - j - 1
print(cnt)