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

from collections import deque

class LinkedList(object):
    def __init__(self):
        self.dq = deque()

    def insert(self, key):
        self.dq.appendleft(key)

    def delete(self, key):
        for i in self.dq:
            if i == key:
                self.dq.remove(key)
                return

    def deleteFirst(self):
        self.dq.popleft()

    def deleteLast(self):
        self.dq.pop()

    def show(self):
        print(' '.join(self.dq))

def run():
    n = int(input())
    linked_list = LinkedList()
    for _ in range(n):
        order = input()
        if order.startswith('insert'):
            linked_list.insert(order.split()[1])
        elif order.startswith('deleteFirst'):
            linked_list.deleteFirst()
        elif order.startswith('deleteLast'):
            linked_list.deleteLast()
        elif order.startswith('delete'):
            linked_list.delete(order.split()[1])
    linked_list.show()

if __name__ == '__main__':
    run()




### FIXED CODE ###

from collections import deque

def run():
    n = int(input())
    dq = deque()
    for _ in range(n):
        order = input()
        if order[0] == 'i':
            dq.appendleft(order[7:])
        elif order[6] == ' ':
            key = order.split()[1]
            if not key in dq:
                continue
            for i in range(len(dq)):
                if dq[i] == key:
                    dq.remove(key)
                    break
        elif order[6] == 'F':
            dq.popleft()
        elif order[6] == 'L':
            dq.pop()

    print(' '.join(dq))

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

N = int(input())

A = []
for i in range(N):
  a = list(input())
  A.append(sorted(a))

count=0
for i in range(N):
  for j in range(i+1, N):
    if A[i]==A[j]:
      count+=1
    
print(count)

### FIXED CODE ###

N=int(input())
D={}
for i in range(N):
  s="".join(sorted(input()))
  if s in D:
    D[s]+=1
  else:
    D[s]=1
ans=0
for x in D.values():
  if x>=2:
    ans+=x*(x-1)//2
print(ans)
### BUGGY CODE ###

from heapq import heappush, heappop
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
ab = [tuple(int(i) for i in input().split()) for _ in range(n)]
ab.sort(key=lambda x: (x[0], -x[1]))
hq = []
result = 0
for i in range(1, m + 1):
    j = 0
    for a, b in ab:
        if a > i:
            break
        j += 1
        heappush(hq, -b)
    ab = ab[j:]
    if hq:
        result -= heappop(hq)
print(result)

### FIXED CODE ###

from heapq import heappush, heappop
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
ab = [tuple(int(i) for i in input().split()) for _ in range(n)]
ab.sort()
hq = []
result = 0
j = 0
for i in range(1, m + 1):
    while j < n and ab[j][0] <= i:
        heappush(hq, -ab[j][1])
        j += 1
    if hq:
        result -= heappop(hq)
print(result)
### BUGGY CODE ###

n,q=map(int,input().split())
s=input()
lr=[input() for i in range(q)]

for i in range(q):
    l,r=map(int,lr[i].split())
    #print(s[l-1:r])
    print(s[l-1:r].count('AC'))


### FIXED CODE ###

n,q=map(int,input().split())
s=input()
lr=[input() for __ in range(q)]
cs=[0]*(n+1)

#端がACで-1で止まる文字列指定は大丈夫？.
for i in range(n):
    cs[i+1]=cs[i] + (1 if s[i:i+2] == 'AC' else 0)

for num in lr:
    l,r=map(int,num.split())
    print(cs[r-1] - cs[l-1])
### BUGGY CODE ###

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

ans = []
for i in range(1, n+1):
    ans.append(a*i//b - a*(i//b))

print(max(ans))

### FIXED CODE ###

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

if n >= b-1:
    x = b-1
else:
    x = n

print(a*x//b - a*(x//b))
### BUGGY CODE ###


def knapsack01rec(n, W, weights, values, dp, i, j):
    # i = up until item i, j = up until weight j
    if i == 0 or j <= 0:
        return 0
    
    if dp[i][j] != -1:
        return dp[i][j]
    
    # start with first item
    if dp[i-1][j] == -1:
        dp[i-1][j] = knapsack01rec(n, W, weights, values, dp, i-1, j)
    
    if weights[i-1] > j:
        # weights[i] doesn't fit in knapsack
        dp[i][j] = dp[i-1][j]
    else:
        if dp[i-1][j-weights[i-1]] == -1:
            dp[i-1][j-weights[i-1]] = knapsack01rec(n, W, weights, values, dp, i-1, j-weights[i-1])
        dp[i][j] = max(dp[i-1][j], dp[i-1][j-weights[i-1]] + values[i-1])
        
    return dp[i][j]

def knapsack01iter(n, W, weights, values, dp):
    for i in range(1,n+1):
        for j in range(0, W+1):
            if j < weights[i-1]: # if knapsack cannot fit item i
                dp[i][j] = dp[i-1][j]
            elif j >= weights[i-1]: # knapsack can fit item i
                dp[i][j] = max(dp[i-1][j], dp[i-1][j-weights[i-1]]+values[i-1])
    
    return dp[-1][-1]
    
    
n,W = [int(x) for x in input().split()]
weights = []
values = []
for i in range(n):
    l = [int(x) for x in input().split()]
    weights += [l[0]]
    values += [l[1]]

# repeatableKnapsack(n, W, weights, values)

dp = [[-1 for _ in range(W+1)] for _ in range(n+1)]
res = knapsack01rec(n, W, weights, values, dp, n, W)
# print(dp)
# dp = [[0 for _ in range(W+1)] for _ in range(n+1)]
# res = knapsack01iter(n, W, weights, values, dp)
# print(dp)
print(res)

### FIXED CODE ###


def knapsack01iter(n, W, weights, values, dp):
    for i in range(1,n+1):
        for j in range(0, W+1):
            if j < weights[i-1]: # if knapsack cannot fit item i
                dp[i][j] = dp[i-1][j]
            elif j >= weights[i-1]: # knapsack can fit item i
                dp[i][j] = max(dp[i-1][j], dp[i-1][j-weights[i-1]]+values[i-1])
    
    return dp[-1][-1]
    
    
n,W = [int(x) for x in input().split()]
weights = []
values = []
for i in range(n):
    l = [int(x) for x in input().split()]
    weights += [l[0]]
    values += [l[1]]

# repeatableKnapsack(n, W, weights, values)

# dp = [[-1 for _ in range(W+1)] for _ in range(n+1)]
# res = knapsack01rec(n, W, weights, values, dp, n, W)
# print(dp)
dp = [[0 for _ in range(W+1)] for _ in range(n+1)]
res = knapsack01iter(n, W, weights, values, dp)
# print(dp)
print(res)
### BUGGY CODE ###

def D():
    nxy=list(map(int,input().split()))
    len_list=[]
    len_count=0
    
    for i in range(1,nxy[0]+1):
        for j in range(i,nxy[0]+1):
            if i<j: len_list.append(min(abs(j-i),abs(nxy[1]-i)+1+abs(j-nxy[2])))
                
    
    len_list.sort()
    for k in range(1,nxy[0]):
        print(len_list.count(k))
    
        
if __name__=='__main__':
    D()

### FIXED CODE ###

def D():
    nxy=list(map(int,input().split()))
    count_list=[0]*nxy[0]
    
    for i in range(1,nxy[0]):
        for j in range(i+1,nxy[0]+1):
            mins=min(abs(j-i),abs(nxy[1]-i)+1+abs(j-nxy[2]))
            count_list[mins]+=1
            
    for i in range(1,nxy[0]):
        print(count_list[i])
            
        
if __name__=='__main__':
    D()
### BUGGY CODE ###

dict={}
N = int(input())
for _ in range(N):
    s = input()
    if s in dict:
        dict[s] += 1
    else:
        dict[s] = 1

A = [k for k,v in dict.items() if v == max(dict.values())]
A.sort()

for a in A:
    print(a)

### FIXED CODE ###

dict={}
N = int(input())
for _ in range(N):
    s = input()
    if s in dict:
        dict[s] += 1
    else:
        dict[s] = 1

max_ = max(dict.values())
A = [k for k,v in dict.items() if v == max_]
A.sort()

for a in A:
    print(a)
### BUGGY CODE ###

x,y=map(int,input().split())
S=[set([x])]
k=0
while(True):
    S.append(set())
    k+=1
    for i in S[k-1]:
        S[k].add(i+1)
        S[k].add(-i)
        if i+1==y or -i==y:
            print(k)
            exit()


### FIXED CODE ###

x,y=map(int,input().split())
a=[0 for i in range(4)]
a[0]=y-x
a[1]=y+x+1
a[2]=-y-x+1
a[3]=-y+x+2
b=[]
for i in range(4):
    if a[i]>0:
        b.append(a[i])
print(min(b))
### BUGGY CODE ###

from heapq import heapify,heappush,heappop
N, M = map(int, input().split())

I = [[0 for _ in range(N)] for _ in range(N)]
for i in range(M):
  A, B = map(int, input().split())
  A -= 1
  B -= 1
  I[A][B] = 1
  I[B][A] = 1

task = [] 
used = [0 for _ in range(N)]
min_len = [0 for _ in range(N)]
length = [10**20 for _ in range(N)]
prev_points = [0 for _ in range(N)]
heappush(task, (0, 0, -1))
print("Yes")

while task:
  while task:
    l, p, prev = heappop(task)    
    if used[p] == 0:
      break
  #print(task)
  used[p] = 1
  min_len[p] = l
  prev_points[p] = prev +1 #番号を1ずらす
  
  for j in range(N):
    if I[p][j] == 0: continue
    #print(p,j)
    if length[j] > l+1:
      length[j] = l+1
      heappush(task, (l+1, j, p))
    I[p][j] = 0
    I[j][p] = 0

for i in range(1, N):
  print(prev_points[i])

### FIXED CODE ###

from heapq import heapify,heappush,heappop
N, M = map(int, input().split())

I = [[] for _ in range(N)]
for i in range(M):
  A, B = map(int, input().split())
  A -= 1
  B -= 1
  I[A].append(B)
  I[B].append(A)

task = [] 
used = [0 for _ in range(N)]
min_len = [0 for _ in range(N)]
length = [10**20 for _ in range(N)]
prev_points = [0 for _ in range(N)]
heappush(task, (0, 0, -1))
print("Yes")

while task:
  while task:
    l, p, prev = heappop(task)    
    if used[p] == 0:
      break
  #print(task)
  used[p] = 1
  min_len[p] = l
  prev_points[p] = prev +1 #番号を1ずらす
  
  for j in I[p]:
    if used[j] == 1: continue
    #print(p,j)
    if length[j] > l+1:
      length[j] = l+1
      heappush(task, (l+1, j, p))
    
for i in range(1, N):
  print(prev_points[i])
### BUGGY CODE ###

import sys
read = sys.stdin.buffer.read # 全読み込み
readline = sys.stdin.buffer.readline # 一行読み込み
readlines = sys.stdin.buffer.readlines # 一行ずつ全読み込み
sys.setrecursionlimit(10**7) # 再帰限界変更（デフォルトは1000）


def main():
    l,r=map(int,readline().rstrip().split())
    
    min_2019=2019

    if l-r>=2019:
        print(0)

    else:
        for i in range(l,r+1):
            for j in range(i+1,r+1):
                tmp=(i*j)%2019
                if min_2019>tmp:
                    min_2019=tmp
                    
        print(min_2019)

if __name__ == '__main__':
    main()

### FIXED CODE ###


l, r = map(int,input().split())
 
ans = 2019
for i in range(l, r):
    for j in range(i+1, r+1):
        tmp = i*j % 2019
        if ans > tmp:
            ans = tmp
        if ans == 0:
            print(ans)
            exit(0)
print(ans)
### BUGGY CODE ###

N, Q = [int(i) for i in input().split()]
S = input()

output = []
for i in range(Q):
    s, t = [int(i) for i in input().split()]
    cnt = S.count('AC', s-1, t)
    output.append(cnt)

for _ in output:
    print(_)

### FIXED CODE ###

N, Q = [int(i) for i in input().split()]
S = input()

t = [0] * (N+1)

for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)
    
for i in range(Q):
    l, r = [int(i) for i in input().split()]
    print(t[r-1] - t[l-1])
### BUGGY CODE ###

N=int(input())
L=list(int(x) for x in input().split())
sum=1
for i in range(N):
	sum=sum*L[i]
if sum > 1000000000000000000:
	print("-1")
else:
	print(sum)

### FIXED CODE ###

N=int(input())
L=list(map(int,input().split()))
if 0 in L:
	print(0)
	exit()
sum=1
for i in range(N):
	sum=sum*L[i]
	if sum > 10**18:
		print(-1)
		exit()
print(sum)
### BUGGY CODE ###

if __name__ == "__main__":

    h,w = list(map(int,input().split()))
    a = [None]*h
    for i in range(h): a[i] = input()

    reached = [[True]*(w+2)]
    for i in range(1, h+1): reached.append([True] + [False]*w + [True])
    reached.append([True]*(w+2))

    q = []
    for i in range(h):
        for j in range(w):
            if a[i][j] == "#":
                q.append([i+1, j+1])
                reached[i+1][j+1] = True

    res = 0
    head = 0
    tail = len(q)
    count = len(q)
    i = 0
    while tail - head > 0:
        k = q[head][0]
        l = q[head][1]
        if not reached[k+1][l]:
            q.append([k+1, l])
            reached[k+1][l] = True
            tail += 1
        if not reached[k][l+1]:
            q.append([k, l+1])
            reached[k][l+1] = True
            tail += 1
        if not reached[k-1][l]:
            q.append([k-1, l])
            reached[k-1][l] = True
            tail += 1
        if not reached[k][l-1]:
            q.append([k, l-1])
            reached[k][l-1] = True
            tail += 1

        head += 1
        i += 1
        if i == count and tail - head > 0:
            count = tail - head
            i = 0
            res += 1
        else:
            pass

    print(res)


### FIXED CODE ###

def main():
  h,w = map(int,input().split())

  q = []
  reached = [[True]*(w+2)]
  for i in range(1, h+1):
    reached.append([True] + [s == '#' for s in list(input())] + [True])
    for j in range(1,w+1):
      if reached[i][j]: q.append((i,j))
  reached.append([True]*(w+2))

  res = 0
  for i in range(100000000):
    qq = []
    for k,l in q:
      if not reached[k+1][l]:
        qq.append((k+1, l))
        reached[k+1][l] = True
      if not reached[k][l+1]:
        qq.append((k, l+1))
        reached[k][l+1] = True
      if not reached[k-1][l]:
        qq.append((k-1, l))
        reached[k-1][l] = True
      if not reached[k][l-1]:
        qq.append((k, l-1))
        reached[k][l-1] = True
    if len(qq) == 0:
      break
    else:
      pass

    q = qq
    res += 1

  print(res)
  return 0

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

import numpy as np
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
k=min(k,41)

for j in range(k):
    b=np.zeros_like(a)
    for i in range(n):
        l=max(0,i-a[i])
        r=min(n-1,i+a[i])
        b[l]+=1
        if r+1<n:
            b[r+1]-=1
    a = np.cumsum(b)
print(" ".join(map(str,a)))

### FIXED CODE ###

n,k=map(int,input().split())
a=[int(i) for i in input().split()]
k=min(k,41)

for j in range(k):
    b=[0 for i in range(n)]
    for i in range(n):
        l=max(0,i-a[i])
        r=min(n-1,i+a[i])
        b[l]+=1
        if r+1<n:
            b[r+1]-=1
    for i in range(1,n):
      b[i]+=b[i-1]
    a=b
print(" ".join(map(str,a)))
### BUGGY CODE ###

import sys
#input = sys.stdin.buffer.readline

def main():
    N = int(input())
    S = input()
    Q = input()
    
    def count(k):
        d,m,dm,dmc = 0,0,0,0
        for i in range(N):
            st = S[i]
            if st == "D":
                d += 1
            elif st == "M":
                m += 1
                dm += d
            elif st == "C":
                dmc += dm
            if i >= k-1:
                if S[i-k+1] == "D":
                    dm -= m
                    d -= 1
                elif S[i-k+1] == "M":
                    m -= 1
        return dmc
        
    x = tuple(map(int,input().split()))
    for k in x:
        print(count(k))
    
if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
#input = sys.stdin.buffer.readline

def main():
    N = int(input())
    S = input()
    Q = input()
    x = tuple(map(int,input().split()))
    for k in x:
        d,m,dm,dmc = 0,0,0,0
        for i in range(N):
            st = S[i]
            if st == "D":
                d += 1
            elif st == "M":
                m += 1
                dm += d
            elif st == "C":
                dmc += dm
            if i >= k-1:
                if S[i-k+1] == "D":
                    dm -= m
                    d -= 1
                elif S[i-k+1] == "M":
                    m -= 1
        print(dmc)
    
if __name__ == "__main__":
    main()
### BUGGY CODE ###

#!/usr/bin/env pypy3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys,collections

N = int(sys.stdin.readline())
#a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
a = list(map(int,input().split()))

import math
acc = a[0]
LIMIT=max(a)
minPrime = [0]*(LIMIT+1)
minPrime[1] = 1
def make():
    for i in range(2,LIMIT+1):
        if minPrime[i] == 0:
            minPrime[i] = i
            #print(i)
            for j in range(i+i,LIMIT+1,i):
                #print(i,j)
                if minPrime[j] == 0:
                    minPrime[j] = i
make()
# def factrial(N):
#     ret = []
#     while minPrime[N] != N:
#         ret.append(minPrime[N])
#         N = N//minPrime[N]
#     if N != 1:
#         ret.append(N)
#     return ret

def factrial(N):
    ret = set()
    while 1 != N:
        ret.add(minPrime[N])
        N = N//minPrime[N]
    if N != 1:
        ret.add(N)
    return ret

for i in range(N):
    acc = math.gcd(acc,a[i])
if acc != 1:
    print("not coprime")
    exit()

pairwise = True
p = set() #all prime
for e in a:
    if not pairwise:
        break
    f = factrial(e)
    if p & f != set():
        pairwise = False
        print("setwise coprime")
        exit(0)
    p = p | f

if pairwise:
    print("pairwise coprime")
else:
    print("setwise coprime")


### FIXED CODE ###

import math
from collections import defaultdict
pc = True
n = int(input())
a = list(map(int,input().split()))
g = math.gcd(a[0],a[1])
for i in range(2,n):
    g = math.gcd(g,a[i])
M = max(a)
class Sieve_of_Eratosthenes:
    def __init__(self, N):
        self.sieve = [-1] * (N+1)
 
        for i in range(2,N+1):
            if self.sieve[i] == -1:
                for j in range(1,1+N//i):
                    self.sieve[i*j] = i
 
    def isprime(self, num):
        if num <= 1:
            return False
        else:
            return self.sieve[num] == num
 
    def factorization(self, num):
        ret = set([])
        while num != 1:
            div = self.sieve[num]
            ret.add(div)
            num //= div
        return ret
 
sofe = Sieve_of_Eratosthenes(M)
ddic = defaultdict()
judge = set([])
 
for i in a:
    if not pc:
        break
    asf = sofe.factorization(i)
    
    if judge & asf != set():
        pc = False
    judge |= asf
if pc:
    print("pairwise coprime")
elif g == 1:
    print("setwise coprime")
else:
    print("not coprime")
### BUGGY CODE ###

def resolve():
    N, K = map(int, input().split())
    p = list(map(int, input().split()))
    ans = 0
    l = []
    for i in range(K):
        l.append((p[i]*(p[i]+1))//2/p[i])
    ans = sum(l)
    for i in range(K, N):
        l[i%K] = (p[i]*(p[i]+1))//2/p[i]
        tmp = sum(l)
        if ans < tmp:
            ans = tmp
    print(ans)
resolve()

### FIXED CODE ###

def resolve():
    N, K = map(int, input().split())
    p = list(map(int, input().split()))
    l = [0]*N
    l[0] = p[0]+1
    for i in range(1, N):
        l[i] = l[i-1]+p[i]+1
    ans = l[K-1]
    for i in range(N-K):
        tmp = l[K+i]-l[i]
        if tmp > ans:
            ans = tmp
    print(ans/2)
resolve()
### BUGGY CODE ###

X,Y,Z,K = map(int,input().split())
A = [i for i in map(int,input().split())]
B = [i for i in map(int,input().split())]
C = [i for i in map(int,input().split())]
AB = []
for a in A:
    for b in B:
        AB.append(a+b)
AB.sort(reverse=True)
ABC = []
for i in range(min(K,len(AB))):
    for j in range(len(C)):
        ABC.append(AB[i]+C[j])
ABC.sort(reverse=True)
for i in range(min(K,len(ABC))):
    print(ABC[i])

### FIXED CODE ###

X,Y,Z,K = map(int,input().split())
A = [i for i in map(int,input().split())]
B = [i for i in map(int,input().split())]
C = [i for i in map(int,input().split())]
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
ABC = []
for i in range(X):
    for j in range(Y):
        if (i+1) * (j+1) > K:
            break
        for k in range(Z):
            if (i+1) * (j+1) * (k+1) > K:
                break
            ABC.append(A[i] +  B[j] + C[k])
ABC.sort(reverse=True)
for i in range(K):
    print(ABC[i])
### BUGGY CODE ###

T = list(input())

num = T.count('?')
for _ in range(num):
    tmp = T.index('?')
    T[tmp] = 'D'

print(''.join(T))

### FIXED CODE ###

T = input()
print(T.replace('?', 'D'))
### BUGGY CODE ###

import sys
input = sys.stdin.readline

INF = float('inf')

N = int(input().strip())
data = [list(map(int, input().split())) for _ in range(N)]
cost_b = []
cost_D = []
for b in range(1<<N):
  towns = []
  cost = INF
  for i in range(N):
    if (b>>i)&1:
      towns.append(data[i])
  for i in range(len(towns)):
    X = towns[i][0]
    cost = min(cost,sum(abs(towns[j][0]-X)*towns[j][2] for j in range(len(towns))))
  for i in range(len(towns)):
    Y = towns[i][1]
    cost = min(cost,sum(abs(towns[j][1]-Y)*towns[j][2] for j in range(len(towns))))
  if len(towns) == 0:
    cost = 0
  cost_b.append(cost)
  cost_D.append(sum(min(abs(towns[j][0]),abs(towns[j][1]))*towns[j][2] for j in range(len(towns))))

dp = [[INF]*(N+1) for i in range(1<<N)]

for i in range(1<<N):
  dp[i][0] = cost_D[i]
count = 0
for k in range(1,N+1):
  for i in range(1<<N)[::-1]:
    x = i
    while x>=0:
      x &= i
      new = dp[i-x][k-1]+cost_b[x]
      if dp[i][k] > new:
        dp[i][k] = new
      x -= 1
for i in range(N+1):
  print(dp[-1][i])

### FIXED CODE ###

import sys
input = sys.stdin.readline

INF = float('inf')

N = int(input().strip())
data = [list(map(int, input().split())) for _ in range(N)]
cost_b = []
cost_D = []
for b in range(1<<N):
  towns = []
  cost = INF
  for i in range(N):
    if (b>>i)&1:
      towns.append(data[i])
  for i in range(len(towns)):
    X = towns[i][0]
    cost = min(cost,sum(abs(towns[j][0]-X)*towns[j][2] for j in range(len(towns))))
  for i in range(len(towns)):
    Y = towns[i][1]
    cost = min(cost,sum(abs(towns[j][1]-Y)*towns[j][2] for j in range(len(towns))))
  if len(towns) == 0:
    cost = 0
  cost_b.append(cost)
  cost_D.append(sum(min(abs(towns[j][0]),abs(towns[j][1]))*towns[j][2] for j in range(len(towns))))

dp = [[INF]*(N+1) for i in range(1<<N)]

for i in range(1<<N):
  dp[i][0] = cost_D[i]
count = 0
for k in range(1,N+1):
  for i in reversed(range(1<<N)):
    x = i
    while x>=0:
      x &= i
      new = dp[i-x][k-1]+cost_b[x]
      if dp[i][k] > new:
        dp[i][k] = new
      if new == 0:
        break
      x -= 1
for i in range(N+1):
  print(dp[-1][i])
### BUGGY CODE ###

n = int(input())
st = list(map(int,input().split()))
lst = [0] * n
for i in range(n):
  lst[i] =(st.index(i+1)+1)
for i in lst:
  print(i,end=" ")

### FIXED CODE ###

n = int(input())
st = list(map(int,input().split()))
srtkey = lambda x: x[1] 
ans = []
for i,j in zip(range(n),st):
  ans.append([i+1,j])
srt = sorted(ans,key=srtkey)
for i,j in srt:
  print(i,end=" ")
### BUGGY CODE ###

S = list(input())
T = list(input())
m, n = len(S), len(T)
C = [['' for j in range(n+1)] for i in range(m+1)]
for i in range(m):
    for j in range(n):
        if S[i] == T[j]:
            C[i+1][j+1] = C[i][j]+S[i]
        elif len(C[i+1][j]) >= len(C[i][j+1]):
            C[i+1][j+1] = C[i+1][j]
        else:
            C[i+1][j+1] = C[i][j+1]
print(C[m][n])


### FIXED CODE ###

S = input()
T = input()
m, n = len(S), len(T)
C = [[0 for j in range(n+1)] for i in range(m+1)]
for i in range(m):
    for j in range(n):
        if S[i] == T[j]:
            C[i+1][j+1] = C[i][j] + 1
        else:
            C[i+1][j+1] = max(C[i][j+1], C[i+1][j])
l = C[m][n]
X = ''
while l:
    if S[m-1] == T[n-1]:
        X = S[m-1]+X
        m -= 1
        n -= 1
        l -= 1
    elif C[m][n] == C[m-1][n]:
        m -= 1
    else:
        n -= 1
print(X)
### BUGGY CODE ###

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

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

for i in range(N - K):
  list_a = list(A[i:i+K])
  list_b = list(A[i+1:i+K+1])
  list_a.sort()
  list_b.sort()
  if list_a < list_b:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

N, K = list(map(int,input().split()))
 
A = list(map(int,input().split()))
 
for i in range(N - K):
  if A[i] < A[i + K]:
    print("Yes")
  else:
    print("No")