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

#dj 16D8101012J ito jun
n = int(input())
for _ in range(n):
    a = input()
    b = input()
    na=len(a)
    nb=len(b)
    array = [[0 for i in range(nb+1)] for j in range(na+1)]
    for i in range(1,na+1):
        for j in range(1,nb+1):
            c = 0
            if a[i-1] == b[j-1]:
                c = 1
            array[i][j] = max(
                array[i-1][j],
                array[i][j-1],
                array[i-1][j-1]+c)
    print(array[na][nb])



### FIXED CODE ###

#dj 16D8101012J ito jun
import sys
def search(a,b):
    na=len(a)
    nb=len(b)
    array = [[0]*(nb+1) for _ in range(na+1)]
    for i,x in enumerate(a,1):
        prerow=array[i-1]
        row=array[i]
        for j,y in enumerate(b,1):
            if x == y:
                row[j]=prerow[j-1]+1
            elif prerow[j] < row[j-1]:
                row[j] = row[j-1]
            else:
                row[j] = prerow[j]
    return array[-1][-1]

n = int(input())
strs = [list(i) for i in sys.stdin.read().splitlines()]
result = [search(strs[i*2], strs[i*2+1]) for i in range(n)]
print(*result, sep="\n")
### BUGGY CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, Q: int, a: "List[int]", b: "List[int]", p: "List[int]", x: "List[int]"):
    edges = [set() for i in range(N+1)]
    score = [0] * (N+1)

    for i in range(N-1):
        edges[a[i]].add(b[i])

    for i in range(Q):
        # print(p[i], [z for z in edges[p[i]] if z > p[i]], x[i])
        # すべての以下のものに配布されるようにする
        tl = [p[i]]
        al = {p[i]}
        while(len(tl) != 0):
            t = tl.pop(0)
            tl += edges[t]
            al |= set(tl)
        for y in al:
            score[y] += x[i]

    print(' '.join(map(str,score[1:])))

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    Q = int(next(tokens))  # type: int
    a = [int()] * (N-1)  # type: "List[int]" 
    b = [int()] * (N-1)  # type: "List[int]" 
    for i in range(N-1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    p = [int()] * (Q)  # type: "List[int]" 
    x = [int()] * (Q)  # type: "List[int]" 
    for i in range(Q):
        p[i] = int(next(tokens))
        x[i] = int(next(tokens))
    solve(N, Q, a, b, p, x)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, Q: int, a: "List[int]", b: "List[int]", p: "List[int]", x: "List[int]"):
    dedges = [set() for i in range(N+1)]
    uedges = [set() for i in range(N+1)]
    score = [0] * (N+1)

    for i in range(N-1):
        dedges[a[i]].add(b[i])
        # uedges[b[i]].add(a[i])

    # 自分以下のすべての子ノードを記録するようにする
    for i in range(Q):
        score[p[i]] += x[i]

    for i in range(1, N+1):
        for j in dedges[i]:
            score[j] += score[i]

    print(' '.join(map(str, score[1:])))


    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    Q = int(next(tokens))  # type: int
    a = [int()] * (N-1)  # type: "List[int]" 
    b = [int()] * (N-1)  # type: "List[int]" 
    for i in range(N-1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    p = [int()] * (Q)  # type: "List[int]" 
    x = [int()] * (Q)  # type: "List[int]" 
    for i in range(Q):
        p[i] = int(next(tokens))
        x[i] = int(next(tokens))
    solve(N, Q, a, b, p, x)

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

import sys
 
a = []
for l in sys.stdin:
    a.append(l)
 
target = a[int(a[0])]
num = 0

sortedA = []

for i in a:
    sortedA.append(''.join(sorted(i)))
sortedA.pop(0)

for i in range(0, len(a) - 1):
    for j in range(i + 1, len(a) - 1):
        if sortedA[i] == sortedA[j]:
            num = num + 1
print(num)

### FIXED CODE ###

import sys
import collections

n=int(input())
a=[''.join(sorted(input())) for _ in range(n)]

ans = 0
for v in collections.Counter(a).values():
    if v != 1:
        ans += v * (v - 1) // 2
print(ans)
### BUGGY CODE ###

from collections import deque
from collections import defaultdict

N,M=map(int,raw_input().split())
nl=[ [] for i in range(N+1) ]
cost={}

for i in range(M):
	L,R,D=map(int,raw_input().split())
	if i==0:start=L
	nl[L].append(R)
	nl[R].append(L)
	cost[(L,R)]=D
	cost[(R,L)]=-D


d=[ None for i in range(N+1) ]
V=[ 0 for i in range(N+1) ]
V2=[]

def dfs(start):
	q = deque([]) 
	V[start]=1
	d[start]=0
	q.append(start)

	while len(q)!=0:
		v=q.pop()
		for i in nl[v]:
			if V[i]!=1:
				V[i]=1
				V2.append((v,i))
				q.append(i)
				d[i]=d[v]+cost[(v,i)]
			
			if (v,i) not in V2:
				if d[v]-d[i]!=cost[(i,v)]:
					print "No"
					quit()

for i in range(1,N+1):
	if V[i]==0:
		dfs(i)
else:
	print "Yes"




### FIXED CODE ###

from collections import deque
from collections import defaultdict

N,M=map(int,raw_input().split())
nl=[ [] for i in range(N+1) ]
cost={}

for i in range(M):
	L,R,D=map(int,raw_input().split())
	if i==0:start=L
	nl[L].append(R)
	nl[R].append(L)
	cost[(L,R)]=D
	cost[(R,L)]=-D


d=[ None for i in range(N+1) ]
V=[ 0 for i in range(N+1) ]

def dfs(start):
	q = deque([]) 
	V[start]=1
	d[start]=0
	q.append(start)

	while len(q)!=0:
		v=q.pop()
		for i in nl[v]:
			if V[i]!=1:
				V[i]=1
				q.append(i)
				d[i]=d[v]+cost[(v,i)]
			else:
				if d[i]-d[v]!=cost[(v,i)]:
					print "No"
					quit()

for i in range(1,N+1):
	if V[i]==0:
		dfs(i)
else:
	print "Yes"
### BUGGY CODE ###

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

print(*[A.index(i)+1 for i in range(1, N+1)])

### FIXED CODE ###

import numpy as np

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

print(*np.argsort(A)+1)
### BUGGY CODE ###

#ABC142_C
from operator import itemgetter
N=int(input())
A=list(map(int,input().split()))

ans=[]

while len(ans)!=len(A):
    min_index=A.index(min(A))
    ans.append(int(min_index)+1)
    A[min_index]=int(1e+5+1)
print(*ans)

### FIXED CODE ###

#ABC142_C
from operator import itemgetter
N=int(input())
A=list(map(int,input().split()))
ans=[i+1 for i,_ in sorted(enumerate(A),key=itemgetter(1))]

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

import sys
readline = sys.stdin.readline

MOD = 10**9+7
def frac(limit):
    frac = [1]*limit
    for i in range(2,limit):
        frac[i] = i * frac[i-1]%MOD
    fraci = [None]*limit
    fraci[-1] = pow(frac[-1], MOD -2, MOD)
    for i in range(-2, -limit-1, -1):
        fraci[i] = fraci[i+1] * (limit + i + 1) % MOD
    return frac, fraci
frac, fraci = frac(41398)
def comb(a, b):
    if not a >= b >= 0:
        return 0
    return frac[a]*fraci[b]*fraci[a-b]%MOD


N, K = map(int, readline().split())
A = list(map(int, readline().split()))

dp = [0]*(N+1)
dp[0] = 1

for i in range(K):
    a = A[i]
    dp2 = [0]*(N+1)
    for j in range(N+1):
        d = dp[j]
        for k in range(min(a, N-j)+1):
            dp2[j+k] = (dp2[j+k] + d*comb(N-j, k)*comb(N-k, a-k)) %MOD
    dp = dp2[:]
print(dp[N])


### FIXED CODE ###

import sys
readline = sys.stdin.readline

MOD = 10**9+7
def frac(limit):
    frac = [1]*limit
    for i in range(2,limit):
        frac[i] = i * frac[i-1]%MOD
    fraci = [None]*limit
    fraci[-1] = pow(frac[-1], MOD -2, MOD)
    for i in range(-2, -limit-1, -1):
        fraci[i] = fraci[i+1] * (limit + i + 1) % MOD
    return frac, fraci
frac, fraci = frac(1398)
def comb(a, b):
    if not a >= b >= 0:
        return 0
    return frac[a]*fraci[b]*fraci[a-b]%MOD


N, K = map(int, readline().split())
A = list(map(int, readline().split()))

dp = [0]*(N+1)
dp[0] = 1

for i in range(K):
    a = A[i]
    dp2 = [0]*(N+1)
    for j in range(N+1):
        d = dp[j]
        if not d:
            continue
        for k in range(min(a, N-j)+1):
            dp2[j+k] = (dp2[j+k] + d*comb(N-j, k)*comb(N-k, a-k)) %MOD
    dp = dp2[:]
print(dp[N])
### BUGGY CODE ###

import math
n = int(input())
for i in range(n):
    count = 0
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == (i + 1):
                    count += 1
    print(count)

### FIXED CODE ###

n = int(input())
ans=[0]*(n+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            a = x * x + y * y + z * z + x * y + y * z + z * x
            if n >= a >= 1:
                ans[a] += 1
print(*ans[1:],sep="\n")
### BUGGY CODE ###

n = int(input())
a_list = list(map(int, input().split()))
nums = set(a_list)
r_list = [0]*(10**5+2)
for n in nums:
	count = a_list.count(n)
	r_list[n] += count
	r_list[n+1] += count
	if n > 0:
		r_list[n-1] += count
print(max(r_list))

### FIXED CODE ###

n = int(input())
a_list = list(map(int, input().split()))
r_list = [0]*(10**5+2)
for n in a_list:
	r_list[n] += 1
	r_list[n+1] += 1
	if n > 0:
		r_list[n-1] += 1
print(max(r_list))
### BUGGY CODE ###

import math
a,b,n=map(int,input().split())
ans=0
if b>n:
  ans=math.floor(a*n/b)
else:
  for i in range(1,n+1):
    c=math.floor(a*i/b)-a*math.floor(i/b)
    ans=max(ans,c)
print(ans)


### FIXED CODE ###

import math
a,b,n=map(int,input().split())
ans=0
if b>n:
  ans=math.floor(a*n/b)
else:
  
  ans=math.floor(a*(b-1)/b)
print(ans)
### BUGGY CODE ###

import functools
import threading
import sys


class SearchProblem(object):
    def __init__(self, N, H, K):
        self.N = N
        self.H = H
        self.K = K

    def isEnd(self, i):
        return i == self.N

    def succ(self, i):
        res = []
        for k in range(1, self.K + 1):
            if i + k <= self.N:
                res.append((i + k, abs(self.H[i + k] - self.H[i])))

        return res


def solve(problem: SearchProblem):
    @functools.lru_cache(maxsize=None)
    def future_cost(s):
        if problem.isEnd(s):
            return 0
        else:
            return min(
                cost + future_cost(next_state) for next_state, cost in problem.succ(s)
            )

    return future_cost(1)


def main():
    N, K = [int(x) for x in input().split(" ")]
    H = [None] + [int(x) for x in input().split(" ")]
    problem = SearchProblem(N, H, K)
    print(solve(problem))


if __name__ == "__main__":

    sys.setrecursionlimit(1024 * 1024 * 2)
    threading.stack_size(128 * 1024 * 1024 * 2)
    threading.Thread(target=main).start()


### FIXED CODE ###

import functools
import threading
import sys


def main():
    @functools.lru_cache(maxsize=None)
    def solve(n):
        if n == 1:
            return 0
        else:
            return min(
                solve(n - k) + abs(H[n] - H[n - k])
                for k in range(1, K + 1)
                if n - k >= 1
            )

    N, K = [int(x) for x in input().split(" ")]
    H = [None] + [int(x) for x in input().split(" ")]
    print(solve(N))


if __name__ == "__main__":

    sys.setrecursionlimit(1024 * 1024 * 2)
    threading.stack_size(128 * 1024 * 1024 * 2)
    threading.Thread(target=main).start()
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
m =  10**18 
ans = 1
for i in range(N):
  ans *= A[i]
#
if ans > m:
  print(-1)
else:
  print(ans)
#

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
m =  10**18 
ans = 1
A.sort()
for i in range(N):
  ans *= A[i]
  if ans > m:
    print(-1)
    exit(0)
  if ans == 0:
    break;
#
print(ans)
#
### BUGGY CODE ###

N = int(input())
temp_n = N

kaisuu = 0

if N % 2 == 1:
    print(0)
else:
    for i in range(N,1,-2):
        temp_n = i
        while temp_n % 5 == 0:
            kaisuu += 1
            temp_n = temp_n // 5

    print(kaisuu)

### FIXED CODE ###

N = int(input())

if N % 2 == 1:
    print(0)
else:
    base_num = 10
    sum = 0
    while N >= base_num:
        sum += N // base_num
        base_num *= 5

    print(sum)
### BUGGY CODE ###

n = int(input())
dList = list(map(int,input().split()))
result = []

for i in range(n):
  if (i % 2 == 0 and n % 2 == 0) or (i % 2 != 0 and n % 2 != 0):
   result.append(dList[i])
  else:
   result.insert(0,dList[i])

for i in result:
  print(i,end=" ")

print()


### FIXED CODE ###

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

for i in range(n):
  if (i % 2 == 0 and n % 2 == 0) or (i % 2 != 0 and n % 2 != 0):
   result.append(dList[i])
  else:
   result.appendleft(dList[i])

for i in result:
  print(i,end=" ")

print()
### BUGGY CODE ###

k = int(input())
s = list(input())
mod = 10 ** 9 + 7

nagasa = len(s)


ans = pow(26, k, mod)
bunbo = 1
bunshi = 1
for i in range(1, k + 1):
    bunbo *= nagasa - 1 + i
    bunshi *= pow(i, mod - 2, mod)
    bunbo %= mod
    bunshi %= mod
    temp = bunbo * bunshi
    temp %= mod
    temp *= pow(25, i, mod)
    temp %= mod
    temp *= pow(26, k - i, mod)
    temp %= mod
    ans += temp
    ans %= mod

print(ans)


### FIXED CODE ###

k = int(input())
s = list(input())
mod = 10 ** 9 + 7

nagasa = len(s)


ans = pow(26, k, mod)
bunbo = 1
bunshi = 1
for i in range(1, k + 1):
    bunbo *= nagasa - 1 + i
    bunshi *= pow(i, mod - 2, mod)
    bunbo %= mod
    bunshi %= mod
    temp = bunbo * bunshi
    temp %= mod
    temp *= pow(25, i, mod)
    temp %= mod
    temp *= pow(26, k - i, mod)
    temp %= mod
    ans += temp
    ans %= mod

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

n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
ans=0
for i in range(n):
  for j in range(i+1,n):
    k = j + 1
    while k < n and a[i] < a[j] + a[k]:
      k += 1
      ans += 1
print(ans)

### FIXED CODE ###

import bisect
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
for i in range(n-2):
  for j in range(i+1,n-1):
    ans+=bisect.bisect_left(a,a[i]+a[j])-j-1
print(ans)
### BUGGY CODE ###

n = int(input())
s = 0
for i in range(n):
    s += i
print(s)

### FIXED CODE ###

n = int(input())
print(n * (n-1) // 2)
### BUGGY CODE ###

from math import gcd
k=int(input())
cnt=0
for i in range(1,k+1):
  for p in range(1,k+1):
    for q in range(1,k+1):
      gcd1=gcd(i,p)
      gcd2=gcd(p,q)
      cnt+=gcd(gcd1,gcd2)

      
print(cnt)
  



### FIXED CODE ###

from math import gcd
k=int(input())
cnt=0
for i in range(1,k+1):
  for p in range(1,k+1):
    for q in range(1,k+1):
      gcd1=gcd(i,p)
      
      cnt+=gcd(gcd1,q)

      
print(cnt)
### BUGGY CODE ###

N, K = input().split(" ")
N, K = int(N), int(K)
p_list = [int(i) for i in input().split(" ")]

max_index = 0
max_sum = -10000
for i in range(0, N):
  if i+K > N:
    break
  tmp = sum(p_list[i:i+K])
  if tmp > max_sum:
    max_sum = tmp
    max_index = i

avg = 0
for i in range(max_index, max_index+K):
  avg += (p_list[i]+1) / 2

print(avg)


### FIXED CODE ###

N, K = input().split(" ")
N, K = int(N), int(K)
p_list = [int(i) for i in input().split(" ")]

for i in range(0, N):
  if i+K > N:
    break

  if i == 0:
    max_sum = sum(p_list[0:K])
    now_sum = max_sum
  else:
    now_sum += (p_list[i-1+K] - p_list[i-1])
    if max_sum < now_sum:
      max_sum = now_sum

print((max_sum + K)/2)
### BUGGY CODE ###

N = int(input())

ans = 0

while N > 0:
    ans += N % 10
    ans = ans % 9
    N = N // 10

if ans == 0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = input()

ans = 0

for i in range(len(N)):
    ans += int(N[i])

ans = ans % 9
if ans == 0:
    print('Yes')
else:
    print('No')
### BUGGY CODE ###

from collections import deque
list1=list(map(int,input().split()))
N=list1[0]
K=list1[1]
Q=list1[2]

dl=deque()
point=deque()

for i in range(N):
    point.append(K)

for i in range(Q):
    dl.append(int(input()))

for i in range(Q):
    for i in range(N):
        point[i]=point[i]-1

for i in range(Q):
    point[dl[i]-1]=point[dl[i]-1]+1

for i in range(N):
    if point[i]>0:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

N, K, Q = map(int, input().split())
A = []
P = [0]*N
for q in range(Q):
	A.append(int(input()))
 
for q in range(Q):
	P[A[q]-1] += 1
	
for n in range(N):
	if K - (Q - P[n]) > 0:
		print('Yes')
	else:
		print('No')
### BUGGY CODE ###

import math
 
K = int(input())
 
def gcd(a, b, c):
    g = math.gcd(a, b)
    return math.gcd(g, c)
 
result = sum((gcd(a, b, c) for a in range(1, K + 1) for b in range(1, K + 1) for c in range(1, K + 1)))

print(result)

### FIXED CODE ###

import math

K = int(input())

total = 0
for a in range(1, K + 1):
    for b in range(1, K + 1):
        ab = math.gcd(a, b)
        for c in range(1, K + 1):
            total += math.gcd(ab, c)

print(total)
### BUGGY CODE ###

n=int(input())
l=list(map(int,input().split()))
for m in range(1,n+1):
    print(l.count(m))

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
for i in a:
    ans[i-1]+=1
for i in range(n):
    print(ans[i])
### BUGGY CODE ###

def main():
    n = 13
    mod = 1000000007
    r = 5
    in_str = input()

    amari_list = amari(n)
    l = len(amari_list)

    ans_list = initial(in_str[-1:], n)

    for i, s in enumerate(reversed(in_str)):
        if i == 0:
            continue
        if s == "?":
            tmp_list, ans_list = ans_list, [0]*n
            for j in range(10):
                t = j * amari_list[i % l] % n
                ans_list = shift_add(t, tmp_list, ans_list, mod)
        else:
            t = int(s) * amari_list[i % l] % n
            ans_list = shift(t, ans_list)

    print(ans_list[r] % mod)


def shift(r, num_list):
    l = len(num_list)
    return [num_list[(i + l - r) % l] for i in range(l)]


def shift_add(r, num_list, ans_list, mod):
    l = len(num_list)
    return [(num_list[(i + l - r) % l] + ans_list[i]) % mod for i in range(l)]


def initial(s, n):
    if s == "?":
        return [1 if i < 10 else 0 for i in range(n)]
    else:
        return [1 if i == int(s) else 0 for i in range(n)]


def amari(n):
    ret = []
    for i in range(n+1):
        r = (10**i) % n
        if r in ret:
            return ret
        else:
            ret.append(r)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import numpy as np


def main():
    n = 13
    mod = 1000000007
    r = 5
    in_str = input()

    amari_l = amari_list(n)
    amari_m = amari_matrix(n, amari_l)

    ans_list = initial(in_str[-1:], n)

    for i, s in enumerate(reversed(in_str)):
        if i == 0:
            continue
        if s == "?":
            ans_list = np.dot(ans_list, amari_m[i % len(amari_m)]) % mod
        else:
            t = int(s) * amari_l[i % len(amari_l)] % n
            ans_list = np.roll(ans_list, t)

    print(int(ans_list[r] % mod))


def initial(s, n):
    if s == "?":
        return np.array([1 if i < 10 else 0 for i in range(n)], dtype='int64')
    else:
        return np.array([1 if i == int(s) else 0 for i in range(n)], dtype='int64')


def shift(n, r):
    return np.array([[1 if (i - j + r) % n == 0 else 0 for j in range(n)] for i in range(n)])


def amari_list(n):
    ret = []
    for i in range(n + 1):
        r = 10**i % n
        if r in ret:
            return ret
        else:
            ret.append(r)


def amari_matrix(n, amari_list):
    ret = np.zeros((len(amari_list), n, n))
    for i, j in enumerate(amari_list):
        tmp = np.zeros((n, n))
        for k in range(10):
            tmp += shift(n, j * k % n)
        ret[i] = tmp
    return ret


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

N,Q=map(int,input().split())
S=list(input())
L=list()
for i in range(N-1):
  if S[i]=="A" and S[i+1]=="C":
    S[i]="a"
t=[0]*(N+2)
for i in range(N):
  t[i+2]=S[:i+1].count("a")
for i in range(Q):
  n,m=map(int,input().split())
  print(t[m]-t[n])

### FIXED CODE ###

N,Q=map(int,input().split())
S=input()
L=[0]*N
for i in range(1,N):
  if S[i-1]=="A" and S[i]=="C":
    L[i]=L[i-1]+1
  else:
    L[i]=L[i-1]
for i in range(Q):
  a,b=map(int,input().split())
  print(L[b-1]-L[a-1])
### BUGGY CODE ###

N,Q=map(int,input().split())
S=input()
for i in range(Q):
    l,r=map(int,input().split())
    s=S[l-1:r]
    print(s.count("AC"))

### FIXED CODE ###

N,Q=map(int,input().split())
S=input()
count=[0]*N
for i in range(1,N):
    count[i]+=count[i-1]
    if S[i-1]=="A" and S[i]=="C":
        count[i]+=1
for i in range(Q):
    l,r=map(int,input().split())
    print(count[r-1]-count[l-1])
### BUGGY 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)

### FIXED 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(k):
    if a+i <= b and not a+i in res:
        res.append(a+i)
    if b-i >= a and not b-i in res:
        res.append(b-i)
res.sort()
print(*res)
### BUGGY CODE ###

from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]

if m != 0:
    lin = [int(stdin.readline().rstrip()) for _ in range(m)]
else:
    lin = [-1]

dp = [-1 for _ in range(n+1)]
dp[0] = 1

if lin[0] == 1:
    dp[1] = 0
else:
    dp[1] = 1
    
for i in range(2,n+1):
    if i in lin:
        dp[i] = 0
    else:
        dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%(10**9+7))

### FIXED CODE ###

from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]

lin = [0]*(n+1)

if m != 0:
    for i in range(m):
        lin[int(stdin.readline().rstrip())] = -1

dp = [-1]*(n+1)

dp[0] = 1

if lin[1] == -1:
    dp[1] = 0
else:
    dp[1] = 1

for i in range(2,n+1):
    if lin[i] == -1:
        dp[i] = 0
    else:
        dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%(10**9+7))
### BUGGY CODE ###

s = input()
cntu = 0
cntd = 0
ans = 0

while s != "":
  while s != "":
    if s[0] == "<":
      cntu += 1
      s = s[1:]
    else:
      break
  while s != "":
    if s[0] == ">":
      cntd += 1
      s = s[1:]
    else:
      break
  if cntu == 0:
    ans += cntd*(cntd+1)//2
  elif cntd == 0:
    ans += cntu*(cntu+1)//2
  else:
    ans += max(cntu, cntd)*(max(cntu, cntd)+1)//2 + min(cntu, cntd)*(min(cntu, cntd)-1)//2
  cntu = 0
  cntd = 0

print(ans)

### FIXED CODE ###

s = input()
a = [0] * (len(s)+1)

for i in range(len(s)):
  if s[i] == "<":
    a[i+1] = a[i] + 1

for i in range(len(s)-1, -1, -1):
  if s[i] == ">":
    a[i] = max(a[i], a[i+1]+1)

print(sum(a))