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

import math
import fractions
import collections
import itertools
from collections import deque
d=collections.deque()
S=int(input())
N=len(str(S))
cnt=0

amari=[0]*(N+1)
num=0
#print(d)
for i in range(N):
    amari[i+1]=(S%pow(10,i+1))%2019
#print(amari)
#c=collections.Counter(amari)
#values=list(c.values())	#aのCollectionのvalue値のリスト(n_1こ、n_2こ…)
amari.sort()
#for i in range(len(key)):
#    l.append([key[i],values[i]])#lは[要素i,n_i]の情報を詰めたmatrix
#xprint(l)
buf=0
#print(amari)
for i in range(N-1):
    if amari[i]==amari[i+1]:
        buf=buf+1
    else:
        cnt=cnt+((buf+1)*buf)//2
        buf=0
    #print(buf)
cnt=cnt+(buf*(buf+1))//2
print(cnt)

### FIXED CODE ###

import math
import fractions
import collections
import itertools
from collections import deque
d=collections.deque()
S=list(input())
N=len(S)
cnt=0

amari=[0]*(N+1)
num=0
for i in range(N):
    d.append(int(S[i]))
#print(d)
for i in range(N):
    n=d.pop()
    num=(num+pow(10,i,2019)*n)%2019
    amari[i+1]=num
#print(amari)
#c=collections.Counter(amari)
#values=list(c.values())	#aのCollectionのvalue値のリスト(n_1こ、n_2こ…)
amari.sort()
#for i in range(len(key)):
#    l.append([key[i],values[i]])#lは[要素i,n_i]の情報を詰めたmatrix
#xprint(l)
buf=0
#print(amari)
c=collections.Counter(amari)
values=list(c.values())	#aのCollectionのvalue値のリスト(n_1こ、n_2こ…)
key=list(c.keys())	#先のvalue値に相当する要素のリスト(要素1,要素2,…)
#for i in range(len(key)):
#    l.append([key[i],values[i]])#lは[要素i,n_i]の情報を詰めたmatrix
#xprint(l)
for i in range(len(values)):
    cnt=cnt+(values[i]*(values[i]-1))//2
print(cnt)
### BUGGY CODE ###

s=input()
t=input()

l1,l2 = len(s),len(t)

dp = [['']*(l2+1) for _ in range(l1+1)]

for i in range(1,l1+1):
  for j in range(1,l2+1):
    if s[i-1]==t[j-1]:
      dp[i][j] = dp[i-1][j-1] + s[i-1]
    else:
      if len(dp[i-1][j]) >= len(dp[i][j-1]):
        dp[i][j] = dp[i-1][j]
      else:
        dp[i][j] = dp[i][j-1]
      
print(dp[-1][-1])

### FIXED CODE ###

s=input()
t=input()

l1,l2 = len(s),len(t)

dp = [[0]*(l2+1) for _ in range(l1+1)]
memo = [['']*(l2+1) for _ in range(l1+1)]

for i in range(1,l1+1):
  for j in range(1,l2+1):
    if s[i-1]==t[j-1]:
      dp[i][j] = dp[i-1][j-1] + 1
      memo[i][j] = s[i-1]
    else:
      if dp[i-1][j] >= dp[i][j-1]:
        dp[i][j] = dp[i-1][j]
        memo[i][j] = (i-1,j)
      else:
        dp[i][j] = dp[i][j-1]
        memo[i][j] = (i,j-1)
      
i,j = l1,l2
ans = []
while i > 0 and j > 0:
  if len(memo[i][j]) == 2:
    i, j = memo[i][j]
  else:
    ans.append(memo[i][j])
    i, j = i-1, j-1
    
print(''.join(ans[::-1]))
### BUGGY CODE ###

N=int(input())
s=[]
t=list(map(int,input().split()))
for i in range(N):
    p=0
    for j in t[i+1:]:
        if t[i]&j==0:
            t[i]=t[i]^j
            p+=1
        else:
            s.append(p)
            break
    else:
        s.append(p)
q=N
for i in s:
    q+=i
print(q)    
        

### FIXED CODE ###

N=int(input())
t=list(map(int,input().split()))
l=1
k=t[0]
a=0
for i in range(N):
    while l<N and k&t[l]==0:
        k+=t[l]
        l+=1
    a+=l-i
    k-=t[i]
print(a)
### BUGGY CODE ###

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

ans = 0

for i in range(n):
    sum = a[i]
    if sum == 0:
        ans += 1
    for j in range(i+1, n):
        sum += a[j]
        if sum == 0:
            ans += 1

print(ans)

### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int, input().split()))

ans = 0
sum = [0 for i in range(n+1)]

for i in range(1, n+1):
    sum[i] = sum[i-1] + a[i-1]

count = Counter(sum)

for values in count.values():
    if values >= 2:
        ans += values * (values-1) // 2

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

import math
def main():
  from builtins import input, int, map
  N = int(input())
  A = list(map(int,input().split()))
  B = list(map(int,input().split()))
  C = list(map(int,input().split()))
  A.sort()
  B.sort()
  C.sort()
  n = int(math.log2(N))+1

  ans = 0

  for i in range(N):
    if A[0] >= B[i]:
      continue
    if A[N-1] < B[i]:
      a = N
    else:
      left = 0
      right = N-1
      for _ in range(n):
        if right - left <= 1:
          break
        mid = (left + right) // 2
        if  B[i]> A[mid]:
          left = mid
        else:
          right = mid
      a = left + 1
    if C[N-1] <= B[i]:
      continue
    if C[0] > B[i]:
      c = N
    else:      
      left = 0
      right = N-1
      for _ in range(n):
        if right - left <= 1:
          break
        mid = (left + right) // 2
        if B[i]>= C[mid]:
          left = mid
        else:
          right = mid
      c = len(C[right:])
    ans += a*c
  print(ans)
main()

### FIXED CODE ###

import bisect as bi
def main():
  from builtins import input, int, map
  N = int(input())
  A = list(map(int,input().split()))
  B = list(map(int,input().split()))
  C = list(map(int,input().split()))
  A.sort()
  C.sort()

  ans = 0

  for i in range(N):
    a = bi.bisect_left(A,B[i])
    c = N-bi.bisect_right(C,B[i])
    ans += a*c
  print(ans)
main()
### BUGGY CODE ###

N = int(input())
p = [int(i) for i in input().split()]

ans = 1
for i in p:
  ans = ans * i
  
if ans > 10 ** 18:
  print(-1)
else:
  print(ans)

### FIXED CODE ###

N = int(input())
p = [int(i) for i in input().split()]
ans = 1

if 0 in p:
  print(0)
  exit()
  
for i in range(N):
  ans*=p[i]
  if ans > 10 ** 18:
    print(-1)
    exit()
print(ans)
### BUGGY CODE ###

import sys
mod = 10**9+7
N = int(sys.stdin.readline())
A = tuple(map(int, sys.stdin.readline().split()))
B = []
ans = 0
for i in A:
    B.append(list(bin(i)[2:]))
C = [0 for i in range(60)]
for i in B:
    for l in range(len(i)):
        if i[-(l+1)] == '1':
            C[l] += 1
for i in range(60):
    ans = (ans + C[i]*(N-C[i])*(2**i)) % mod
print(ans)

### FIXED CODE ###

import sys
mod = 10**9+7
N = int(sys.stdin.readline())
A = tuple(map(int, sys.stdin.readline().split()))
B = []
ans = 0
C = [0 for i in range(60)]
for i in A:
    for l in range(60):
        if ((i >> l) & 1) == 1:
            C[l] += 1
for i in range(60):
    t = C[i]
    ans = (ans + t*(N-t)*(2**i)) % mod
print(ans)
### BUGGY CODE ###

from collections import deque

h, w = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())
Ch -= 1
Cw -= 1
Dh -= 1
Dw -= 1
t = [[i for i in range(w)] for j in range(h)]
ans = 0
for i in range(h):
  temp = input()
  for j in range(w):
    t[i][j] = temp[j]

d = deque()
d.append((Ch, Cw))
flag = True
ans = 0
s = set()

while True:
  while flag:
    flag = False
    for _ in range(len(d)):
      Th, Tw = d.popleft()
      for i,j in [(1,0),(-1,0),(0,1),(0,-1),(0,0)]:
        _h = Th + i
        _w = Tw + j
        _p = (_h, _w)
        temp = (Th + i, Tw + i)
        if (not (_p) in d) and _h >= 0 and _h < h and _w >= 0 and _w < w and t[_h][_w] == '.':
          d.append(_p)
          # print(_p)
          if not(i == 0 and j == 0):
            flag = True
  if (Dh,Dw) in d:
    print(ans)
    exit()
  else:
    s |= set(d)
    temps = set(d)
    d = deque()
    for Th,Tw in s:
      for i in [-2,-1,0,1,2]:
        for j in [-2,-1,0,1,2]:
          _h = Th + i
          _w = Tw + j
          _p = (_h, _w)
          temp = (Th + i, Tw + i)
          if (not (_p) in temps) and (not (_p) in d) and _h >= 0 and _h < h and _w >= 0 and _w < w and t[_h][_w] == '.':
            d.append(_p)
    if len(d) == 0:
      print('-1')
      exit()
    ans += 1

### FIXED CODE ###

from collections import deque

h, w = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())
Ch -= 1
Cw -= 1
Dh -= 1
Dw -= 1
t = [[i for i in range(w)] for j in range(h)]
visited = [[0 for i in range(w)] for j in range(h)] # いったところ
ans = 0
for i in range(h):
  temp = input()
  for j in range(w):
    t[i][j] = temp[j]

d = deque([(Ch, Cw)])
ans = 0
a = [(1,0),(-1,0),(0,1),(0,-1)]

while True:
  # 移動A
  stemp = set()
  while len(d) != 0:
    Th, Tw = d.popleft()
    # s.add((Th, Tw))
    visited[Th][Tw] = 1
    stemp.add((Th, Tw))
    if (Th,Tw) == (Dh, Dw):
      print(ans)
      exit()
    for i, j in a:
      _h,_w = Th + i, Tw + j
      _p = (_h, _w)
      if 0 <= _h < h and 0 <= _w < w and t[_h][_w] == '.' and visited[_h][_w] == 0:
        d.append(_p)
        visited[_h][_w] = 1
  # 移動B
  ans += 1
  for Th,Tw in stemp:
    for i in range(-2, 3) :
      for j in range(-2, 3) :
        _h,_w = Th + i, Tw + j
        _p = (_h, _w)
        if 0 <= _h < h and 0 <=  _w < w and t[_h][_w] == '.' and visited[_h][_w] == 0:
          d.append(_p)
  if len(d) == 0:
    print('-1')
    exit()
### BUGGY CODE ###

#!/usr/bin/env python3
import sys
import math
N = int(input())
A = list(map(int,input().split()))

def comb(n, r):
    if n > 1:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    else:
        return 0

dict = {}

for i in range(N):
    if A[i] in dict.keys():
        dict[A[i]] = dict[A[i]] + 1
    else:
        dict[A[i]] = 1

combs = {}

for k in dict:
    combs[k] = comb(dict[k],2)


total = sum(combs.values())

for i in range(N):
    diff = combs[A[i]] - comb(dict[A[i]]-1,2)
    print(total - diff)



### FIXED CODE ###

#!/usr/bin/env python3
import sys
N = int(input())
A = list(map(int,input().split()))

def comb(n):
    if n > 1:
        return n * (n-1) // 2
    else:
        return 0

dict = {}

for i in range(N):
    if A[i] in dict.keys():
        dict[A[i]] = dict[A[i]] + 1
    else:
        dict[A[i]] = 1

combs = {}

for k in dict:
    combs[k] = comb(dict[k])


total = sum(combs.values())

for i in range(N):
    diff = combs[A[i]] - comb(dict[A[i]]-1)
    print(total - diff)
### BUGGY CODE ###

H, W = map(int, input().split())

grid = list()
for _ in range(H):
    grid.append(input())

up = [[0 for _ in range(W)] for _ in range(H)]
down = [[0 for _ in range(W)] for _ in range(H)]
left = [[0 for _ in range(W)] for _ in range(H)]
right = [[0 for _ in range(W)] for _ in range(H)]

for col in range(W):
    cnt = 0
    for row in range(H):
        if grid[row][col] == '.':
            cnt += 1
        else:
            cnt = 0
        up[row][col] = cnt
for col in range(W):
    cnt = 0
    for row in reversed(range(H)):
        if grid[row][col] == '.':
            cnt += 1
        else:
            cnt = 0
        down[row][col] = cnt
for row in range(H):
    cnt = 0
    for col in range(W):
        if grid[row][col] == '.':
            cnt += 1
        else:
            cnt = 0
        left[row][col] = cnt
for row in range(H):
    cnt = 0
    for col in reversed(range(W)):
        if grid[row][col] == '.':
            cnt += 1
        else:
            cnt = 0
        right[row][col] = cnt

ans = 0
for i in range(H):
    for j in range(W):
        if grid[i][j] == '#':
            continue
        lighted = up[i][j] + down[i][j] + left[i][j] + right[i][j] - 3
        ans = max(ans, lighted)
print(ans)

### FIXED CODE ###

import numpy as np


H, W = map(int, input().split())
grid = np.array([list(input()) for _ in range(H)]) == "."

up = np.zeros((H, W), dtype = int)
down = np.zeros((H, W), dtype = int)
left = np.zeros((H, W), dtype = int)
right = np.zeros((H, W), dtype = int)

for i in range(H):
    down[i] = (down[i - 1] + 1) * grid[i]
    up[-i - 1] = (up[-i] + 1) * grid[-i - 1]

for i in range(W):
    right[:, i] = (right[:, i - 1] + 1) * grid[:, i]
    left[:, -i - 1] = (left[:, -i] + 1) * grid[:, -i - 1]

print(np.max(up + down + left + right) - 3)
### BUGGY CODE ###

N = int(input())
A = []
for i in range(N):
  As = list(map(int, input().split()))
  As = list(reversed(list(map(lambda a: a-1, As))))
  A.append(As)
#print(A)
d = 0
n = 0
while True:
  s = set()
  n2 = 0
  for i in range(N):
    if A[i] == []:
      continue
    j = A[i][-1]
    if i in s or j in s:
      continue
    if A[j] == []:
      continue
    if A[j][-1] == i:
      n += 1
      n2 += 1
      A[i].pop()
      A[j].pop()
      s.add(i)
      s.add(j)
  if n2 == 0:
    if n == N*(N-1)//2:
      break
    print(-1)
    exit()
  d += 1
print(d)


### FIXED CODE ###

N = int(input())
A = []
for i in range(N):
  As = list(map(int, input().split()))
  As = list(reversed(list(map(lambda a: a-1, As))))
  A.append(As)
#print(A)
d = 0
n = 0
l = list(range(N))
while True:
  n2 = 0
  l2 = []
  s2 = set()
  for i in l:
    if A[i] == []:
      continue
    j = A[i][-1]
    if A[j] == []:
      continue
    if i in s2 or j in s2:
      continue
    if A[j][-1] == i:
      n += 1
      n2 += 1
      s2.add(i)
      s2.add(j)
      l2.append(i)
      l2.append(j)
      A[i].pop()
      A[j].pop()
  if n2 == 0:
    if n == N*(N-1)//2:
      break
    print(-1)
    exit()
  l = l2
  d += 1
print(d)
### BUGGY CODE ###

s = input()
n = len(s)
counter = [0] * 2019

counter[0] += 1
for i in range(1, n+1):
    counter[int(s[n-i:]) % 2019] += 1

ans = 0
for i in counter:
    ans += (i * (i - 1)) // 2

print(ans)

### FIXED CODE ###

s = input()
n = len(s)
s_cu = [0] * (n+1)
counter = [0] * 2019
counter[0] += 1
for i in range(n):
    s_cu[i+1] = (int(s[n-i-1]) * pow(10,i,2019) + s_cu[i]) % 2019
    counter[s_cu[i+1]] += 1

ans = 0
for i in counter:
    ans += (i * (i - 1)) // 2

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

n, k = map(int, input().split())
h = list(map(int, input().split()))

INF = 10**12
dp = [INF] * n
dp[0] = 0

for i in range(n):
    if i == 1:
        dp[1] = abs(h[1] - h[0])
        continue

    for j in range(1, k + 1):
        if i - j < 0:
            continue
        dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]))
print(dp[-1])


### FIXED CODE ###

n, k = map(int, input().split())
h = list(map(int, input().split()))

INF = 10**12
dp = [INF] * n
dp[0] = 0

for i in range(n):
    if i == 1:
        dp[1] = abs(h[1] - h[0])
        continue

    for j in range(1, k + 1):
        if i - j < 0:
            continue
        dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]))
print(dp[-1])
### BUGGY CODE ###

import numpy as np

n = int(input())
ls = list(map(int, input().split()))
ls.sort()

ans = 0

ab = np.zeros(2001)

ab[(ls[0] + ls[1])] += 1

for i in range(2,n):
    l_temp = ls[i]
    ans += sum(ab[l_temp+1:])

    for j in range(i):
        ab[( l_temp + ls[j] )] += 1

print(int(ans))

### FIXED CODE ###

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

l.sort()

ans = 0
for i in range(n-2):
    l1 = l[i]

    l3_ind = i+2
    for j in range(i+1,n):
        l2 = l[j]
        while(True):
            if(l3_ind == n):
                ans += l3_ind - j - 1
                break

            if(l[l3_ind] >= l1+l2):
                ans += l3_ind - j - 1
                break
            l3_ind += 1
            
print(ans)
### BUGGY CODE ###

N = int(input())
A = [int(s) for s in input().split()]
mod = 10**9+7

seki_list = []
for i in range(N-1):
    seki = sum(A[i+1:])
    seki_list.append(seki)

ans  = 0
for i in range(N-1):
    seki = A[i]*seki_list[i]
    ans += seki

print(ans % mod)

### FIXED CODE ###

N = int(input())
A = [int(s) for s in input().split()]
mod = 10**9+7

wa = 0
wa_list = []
for i in range(N)[::-1]:
    if i == 0:
        break
    wa += A[i]
    wa_list.append(wa)

wa_list.reverse()
ans  = 0
for i in range(N-1):
    seki = A[i]*wa_list[i]
    ans += seki

print(ans % mod)
### BUGGY CODE ###

''' Hey stalker :) '''
INF = 10**10
def main():
    #print = out.append
    ''' Cook your dish here! '''
    n, k = get_list()
    li = get_list()
    ans = 0
    for i in range(n-k+1):
        ans = max(ans, sum(li[i:i+k]))
    print((ans+k)/2)



''' Pythonista fLite 1.1 '''
import sys
from collections import defaultdict, Counter
from bisect import bisect_left, bisect_right
#from functools import reduce
import math
#input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()
#[main() for _ in range(int(input()))]
print(*out, sep='\n')


### FIXED CODE ###

''' Hey stalker :) '''
INF = 10**10
def main():
    print = out.append
    ''' Cook your dish here! '''
    n, k = get_list()
    li = get_list()
    ans = sum(li[:k])
    sm = ans
    for i in range(n-k+1):
        ans = max(ans, sm)
        if i<n-k:
            sm += li[i + k] - li[i]
    print((ans+k)/2)



''' Pythonista fLite 1.1 '''
import sys
from collections import defaultdict, Counter
from bisect import bisect_left, bisect_right
#from functools import reduce
import math
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()
#[main() for _ in range(int(input()))]
print(*out, sep='\n')
### BUGGY CODE ###

h,w=map(int,input().split())
inf=10**3
d=((-1,0),(1,0),(0,-1),(0,1))
S=[["#"]*(w+2)]
S.extend([["#"]+[s for s in input()]+["#"] for _ in range(h)])
S.append(["#"]*(w+2))
import collections
def dist(a,b):
  D=[[inf]*(w+2) for _ in range(h+2)]
  D[a][b]=0
  Visit=collections.deque()
  Visit.append(100*a+b)
  while Visit:
    v=Visit.pop()
    va,vb=v//100,v%100
    for dx,dy in d:
      if S[va+dx][vb+dy]=="#":
        continue
      elif D[va+dx][vb+dy]>D[va][vb]+1:
        Visit.append((va+dx)*100+(vb+dy))
        D[va+dx][vb+dy]=D[va][vb]+1
  ret=0
  for i in range(h):
    for j in range(w):
      if D[i+1][j+1]<inf:
        ret=max(ret,D[i+1][j+1])
  return ret
ans=0
for i in range(h):
  for j in range(w):
    if S[i+1][j+1]==".":
      ans=max(dist(i+1,j+1),ans)
print(ans)





### FIXED CODE ###

h,w=map(int,input().split())
inf=float("inf")
d=((-1,0),(1,0),(0,-1),(0,1))
S=[["#"]*(w+2)]
S.extend([["#"]+[s for s in input()]+["#"] for _ in range(h)])
S.append(["#"]*(w+2))

def dist(a,b):
  if S[a][b]=="#":
    return 0
  else:
    D=[[inf]*(w+2) for _ in range(h+2)]
    D[a][b]=0
    Visit=[100*a+b]
    while Visit:
      v=Visit.pop()
      va,vb=v//100,v%100
      for dx,dy in d:
        if S[va+dx][vb+dy]=="#":
          continue
        elif D[va+dx][vb+dy]>D[va][vb]+1:
          Visit.append((va+dx)*100+(vb+dy))
          D[va+dx][vb+dy]=D[va][vb]+1
    ret=0
    for i in range(h):
      for j in range(w):
        if D[i+1][j+1]<inf:
          ret=max(ret,D[i+1][j+1])
    return ret
ans=0
for i in range(h):
  for j in range(w):
    ans=max(dist(i+1,j+1),ans)
print(ans)
### BUGGY CODE ###

from collections import deque
def main():
    n=int(input())
    dis=[[10**20 for i in range(n)] for i in range(n)]
    g=[[] for i in range(n)]
    for _ in range(n-1):
        a,b,c = map(int,input().split())
        g[a-1].append(b-1)
        g[b-1].append(a-1)
        dis[a-1][b-1] = c
        dis[b-1][a-1] = c
    q,k = map(int,input().split())
    k-=1
    d=deque([k])
    f=[False for i in range(n)]
    dis[k][k]=0
    while d:
        s= d.popleft()
        f[s]= True
        for sg in g[s]:
            if not f[sg]:
                dis[k][sg]= dis[k][s]+dis[s][sg]
                d.append(sg)
    lq=[]
    for _ in range(q):
        lq.append(list(map(int,input().split())))
    for sq in lq:
        print(dis[k][sq[0]-1]+dis[k][sq[1]-1])

main()

### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(10**7)
n=int(input())
d=[10**20 for i in range(n)] 
g=[[] for i in range(n)]
for _ in range(n-1):
    a,b,c = map(int,input().split())
    g[a-1].append([b-1,c])
    g[b-1].append([a-1,c])
q,k = map(int,input().split())
k-=1
f=[False for i in range(n)]
d[k]=0

def dfs(s,c):
    f[s]=True
    d[s]=c
    for sg in g[s]:
        if not f[sg[0]]:
            dfs(sg[0],c+sg[1])
dfs(k,0)

lq=[]
for _ in range(q):
    lq.append(list(map(int,input().split())))
for sq in lq:
    print(d[sq[0]-1]+d[sq[1]-1])
### BUGGY CODE ###

import sys

def lcs_count(A,B):
    # initial value setting
    dp = [[0]*(l2+1) for _ in range(l1+1)]
    # create table
    for i in range(1,l1+1):
        for j in range(1,l2+1):
            if A[i-1] == B[j-1]:
                dp[i][j] = dp[i-1][j-1] + 1
            else:
                dp[i][j] = max(dp[i-1][j],dp[i][j-1])
    return dp

def lcs_string(dp):
    string = []
    for i,j in zip([m for m in range(l1,0,-1)],[n for n in range(l2,0,-1)]):
        if dp[i][j] > dp[i-1][j-1]:
            string.insert(0,chr(s[i-1]+97))
    print("".join(string))

s = [ord(a)-97 for a in list(sys.stdin.readline().rstrip())]
t = [ord(b)-97 for b in list(sys.stdin.readline().rstrip())]
l1 = len(s)
l2 = len(t)

DP = lcs_count(s,t)
lcs_string(DP)



### FIXED CODE ###

import sys

s = [ord(a)-97 for a in list(sys.stdin.readline().rstrip())]
t = [ord(b)-97 for b in list(sys.stdin.readline().rstrip())]
len_s = len(s)
len_t = len(t)

dp = [[0] * (len_t+1) for i in range(len_s+1)]
for i in range(len_s):
    for j in range(len_t):
        if s[i] == t[j]:
            dp[i+1][j+1] = dp[i][j] + 1
        else:
            dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1])

strings = []
while len_s > 0 and len_t > 0:
    if s[len_s-1] == t[len_t-1]:
        len_s -= 1
        len_t -= 1
        strings.insert(0,chr(s[len_s]+97))
    elif dp[len_s][len_t-1] > dp[len_s-1][len_t]:
        len_t -= 1
    else:
        len_s -= 1

print("".join(strings))
### BUGGY CODE ###

n = int(input())
s = input()

a = {}
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      a["".join([s[i],s[j],s[k]])] = 1

print(sum(a.values()))

### FIXED CODE ###

n = int(input())
s = input()

a = 0
ii = [0]*10
for i in range(n-2):
  si = int(s[i])
  if sum(ii) == 10:
    break
  elif ii[si] == 1:
    continue
  else:
    ii[si] = 1
  jj = [0]*10
  for j in range(i+1,n-1):
    sj = int(s[j])
    if sum(jj) == 10:
      break
    elif jj[sj] == 1:
      continue
    else:
      jj[sj] = 1
    kk = [0]*10
    for k in range(j+1,n):
      sk = int(s[k])
      if sum(kk) == 10:
        break
      else:
        kk[sk] = 1
    a += sum(kk)
print(a)
### BUGGY CODE ###

def main():
    N = int(input())
    S = input()
    cnt = 0
    for i in range(N):
        for j in range(i + 1, N):
            for k in range(j + 1, N):
                if j - i == k - j:
                    if S[j] != S[i] and S[i] != S[k] and S[k] != S[j]:
                        cnt += 1
    print(S.count("R") * S.count("B") * S.count("G") - cnt)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    N = int(input())
    S = input()
    cnt = 0
    for i in range(N):
        for j in range(i + 1, N):
            k = 2 * j - i
            if k >= N:
                continue
            if S[j] != S[i] and S[i] != S[k] and S[k] != S[j]:
                cnt += 1
    print(S.count("R") * S.count("B") * S.count("G") - cnt)

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

import sys
from functools import lru_cache

sys.setrecursionlimit(10000000)

h, n = map(int, input().split())
m_list = []
for i in range(n):
  a, b = map(int, input().split())
  m_list.append((a, b))
  
@lru_cache(maxsize=h+1000)
def dp_attack(h):
  res_list = []
  if h <= 0:
    return 0
  for a, b in m_list:
    base_b = dp_attack(h-a)
    res_list.append(base_b+b)
  return min(res_list)

res = dp_attack(h)
print(res)

### FIXED CODE ###

import sys

sys.setrecursionlimit(10000000)

h, n = map(int, input().split())
m_list = []
max_a = 0
for i in range(n):
  a, b = map(int, input().split())
  m_list.append((a, b))
  if a > max_a:
    max_a = a
  
class Attack_Memo():
  def __init__(self):
    self.attack_memo = {}
  
  def attack(self, h):
    res_list = []
    if h <= 0:
      return 0
    if h in self.attack_memo:
      return self.attack_memo[h]
    for a, b in m_list:
      base_b = self.attack(h-a)
      res_list.append(base_b+b)
    self.attack_memo[h] = min(res_list)
    return min(res_list)

res = 100000000000
ins = Attack_Memo()
for i in range(h+a+1):
  tmp = ins.attack(i)
  if i >= h and tmp <= res:
    res = tmp
print(res)
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
B = list()
for i in range(1,N+1):
    B.append(A.index(i)+1)
ans = ' '.join(map(str,B))
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
B = [0] * N
for i in range(N):
    B[A[i]-1] = i+1
print(' '.join(map(str,B)))