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

K, S = map(int, input().split())

ans = 0
for i in range(0, K+1):
    for j in range(0, K+1):
        for k in range(0, K+1):
            if i + j + k == S:
                ans += 1

print(ans)

### FIXED CODE ###

K, S = map(int, input().split())

ans = 0
for i in range(0, K+1):
    for j in range(0, K+1):
        if 0 <= (S-i-j) <= K:
            ans += 1

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

import sys
input = sys.stdin.readline

N = int(input())
A = [int(x) for x in input().split()]

A.append(1)

B = [A[0]]
B_cnt = [1]
for i,(x,y) in enumerate(zip(A[:-1],A[1:])):
    if x < y and y < A[i+2]:
        continue
    if x == y:
        B_cnt[-1] += 1
    else:
        B.append(y)
        B_cnt.append(1)

def test(x):
    digit = [0]
    cnt = [0]
    for a,a_cnt in zip(B,B_cnt):
        if digit[-1] < a:
            digit.append(a)
            cnt.append(a_cnt)
            continue
        if digit[-1] == a:
            cnt[-1] += a_cnt
            continue
        while True:
            # 繰り上がり処理をしながら左に戻る
            if digit[-1] <= a:
                break
            n = digit.pop()
            k = cnt.pop()
            if k <= x:
                continue
            if digit[-1] == n-1:
                cnt[-1] += (k-1)//x
            else:
                digit.append(n-1)
                cnt.append((k-1)//x + 1)
        if digit[-1] == a:
            cnt[-1] += a_cnt
        else:
            digit.append(a)
            cnt.append(1+a_cnt)
    return cnt[1] <= x+1

if all(x<y for x,y in zip(A[:-2],A[1:-1])):
    print(1)
    exit()

left = 1 # 無理
right = 2 # 可能?
while not test(right):
    left *= 2
    right *= 2
while right > left + 1:
    mid = (left+right)//2
    if test(mid):
        right = mid
    else:
        left = mid

answer = right
print(answer)

### FIXED CODE ###

import sys
input = sys.stdin.readline

N = int(input())
A = [int(x) for x in input().split()]

A.append(1)

def test(x):
    digit = [0]
    cnt = [0]
    for a in A:
        if digit[-1] < a:
            digit.append(a)
            cnt.append(1)
            continue
        if digit[-1] == a:
            cnt[-1] += 1
            continue
        while True:
            # 繰り上がり処理をしながら左に戻る
            if digit[-1] <= a:
                break
            n = digit.pop()
            k = cnt.pop()
            if k <= x:
                continue
            if digit[-1] == n-1:
                cnt[-1] += (k-1)//x
            else:
                digit.append(n-1)
                cnt.append((k-1)//x + 1)
        if digit[-1] == a:
            cnt[-1] += 1
        else:
            digit.append(a)
            cnt.append(2)
    return cnt[1] <= x+1

if all(x<y for x,y in zip(A[:-2],A[1:-1])):
    print(1)
    exit()

left = 1 # 無理
right = N # 可能
while right > left + 1:
    mid = (left+right)//2
    if test(mid):
        right = mid
    else:
        left = mid

answer = right
print(answer)
### BUGGY CODE ###

def getIntList(strList):
  return list(map(lambda x: int(x), strList))

N, M, K = getIntList(input().split(" "))
A = getIntList(input().split(" "))
B = getIntList(input().split(" "))

ta = 0
tb = 0
TA = [0]
TB = [0]

for i in range(len(A)):
  ta += A[i]
  if ta <= K:
    TA.append(ta)
  else:
    break
for j in range(len(B)):
  tb += B[j]
  if tb <= K:
    TB.append(tb)
  else:
    break

cnt = []

for i in range(len(TA)):
  for j in range(len(TB)):
#    print(" ".join([str(TA[i]), str(TB[-j-1]), str(K)]))
    if TA[i] + TB[-j-1] <= K:
      cnt.append(i - j + len(TB) - 1)
#      print(" ".join([str(i), str(j), str(len(TB)), "-1"]))
      break

print(max(cnt))
      

### FIXED CODE ###

def getIntList(strList):
  return list(map(lambda x: int(x), strList))

N, M, K = getIntList(input().split(" "))
A = getIntList(input().split(" "))
B = getIntList(input().split(" "))

ta = 0
tb = 0
TA = [0]
TB = [0]

for i in range(len(A)):
  ta += A[i]
  if ta <= K:
    TA.append(ta)
  else:
    break
for j in range(len(B)):
  tb += B[j]
  if tb <= K:
    TB.append(tb)
  else:
    break

Cij = [0]

j = len(TB) - 1
for i in range(len(TA)):
  while TA[i] + TB[j] > K:
    j += -1
  else:
    if j >= 0:
      Cij.append(i + j)
  if j == -1:
    break


print(max(Cij))
### BUGGY CODE ###

N, M = map(int, input().split())
a = [0]*M
b = [0]*M
c = [0]*M
for i in range(M):
	x, y, z = map(int, input().split())
	a[i] = x
	b[i] = y
	c[i] = -z

INF = float('inf')
d = [INF]*N
d[0] = 0

for _ in range(N-1):
	for i in range(M):
		if d[a[i]-1]==INF:
			continue
		if d[b[i]-1]>d[a[i]-1]+c[i]:
			d[b[i]-1] = d[a[i]-1] + c[i]

ans = -d[N-1]

negative = [False]*N
for _ in range(N):
	for i in range(M):
		if d[a[i]-1]==INF:
			continue
		if d[b[i]-1]>d[a[i]-1]+c[i]:
			d[b[i]-1] = d[a[i]-1] + c[i]
			negative[b[i]-1] = True
		if negative[a[i]-1]==True:
			negative[b[i]-1] = True

if negative[N-1]==True:
	print('inf')
else:
	print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
a = [0]*M
b = [0]*M
c = [0]*M
for i in range(M):
	x, y, z = map(int, input().split())
	a[i] = x
	b[i] = y
	c[i] = -z

INF = float('inf')
d = [INF]*N
d[0] = 0

for _ in range(N-1):
	for i in range(M):
		if d[a[i]-1]==INF:
			continue
		if d[b[i]-1]>d[a[i]-1]+c[i]:
			d[b[i]-1] = d[a[i]-1] + c[i]

ans = -d[N-1]

negative = [False]*N
for _ in range(N):
	for i in range(M):
		if d[a[i]-1]==INF:
			continue
		if d[b[i]-1]>d[a[i]-1]+c[i]:
			d[b[i]-1] = d[a[i]-1] + c[i]
			negative[b[i]-1] = True
		if negative[a[i]-1]==True:
			negative[b[i]-1] = True

if negative[N-1]==True:
	print('inf')
else:
	print(ans)
### BUGGY CODE ###

H, W = map(int, input().split())
board = []
visited = [[False for _ in range(W)] for _ in range(H)]
goal_dst = float("inf")
no = 0

for _ in range(H):
	board.append(list(map(str, input())))
	no += board[-1].count("#")
	
# bfsで最短路を求める
Q = [[0, 0, 1]]
juuji = [[-1, 0], [1, 0], [0, -1], [0, 1]]

while Q:
	cur = Q.pop(0)
	visited[cur[0]][cur[1]] = True
	dist = cur[2]
	if cur[0] == H - 1 and cur[1] == W - 1:
		goal_dst = min(goal_dst, dist)
	if goal_dst < dist: continue
	for move in juuji:
		new_y = cur[0] + move[0]
		new_x = cur[1] + move[1]
		if not (0 <= new_x and new_x <= W - 1 and 0 <= new_y and new_y <= H - 1): continue 
		if board[new_y][new_x] == "." and visited[new_y][new_x] == False:
			Q.append([new_y, new_x, dist + 1])
			
if goal_dst == float("inf"):
	print(-1)
else:
	print(H * W - goal_dst - no)

### FIXED CODE ###

from heapq import heappush, heappop
H, W = map(int, input().split())
s = [input() for _ in range(H)]

dist = [[float('inf')] * W for _ in range(H)]
q = [(0, 0, 0)]
while q :
    cost, cx, cy = heappop(q)
    if cost >= dist[cy][cx] :
        continue
    dist[cy][cx] = cost
        
    for dx, dy in ((0, 1), (0, -1), (1, 0), (-1, 0)) :
        if 0 <= cx + dx < W and 0 <= cy + dy < H and s[cy+dy][cx+dx] != '#' :
            heappush(q, (cost+1, cx+dx, cy+dy))
            
if dist[H-1][W-1] == float('inf') :
    print(-1)
else :
    ret = 0
    for s_ in s :
        ret += s_.count('#')
    print(H * W - ret - dist[H-1][W-1] - 1)
### BUGGY CODE ###

K,S=map(int,input().split())
ans=0
for X in range(K+1):
	for Y in range(K+1):
		for Z in range(K+1):
			if X+Y+Z==S:
				ans=ans+1
print(ans)

### FIXED CODE ###

K,S=map(int,input().split())
ans=0
for X in range(K+1):
	for Y in range(K+1):
		if 0<=S-X-Y<=K:
			ans=ans+1
print(ans)
### BUGGY CODE ###

N,K=map(int,input().split(" "))
H=[int(input()) for _ in range(N)]
H.sort()
tmax=10**9
for a in range(N-K+1):
    h=H[a:K+a]
    tmax=min(tmax,abs(h[-1]-h[0]))
print(tmax)

### FIXED CODE ###

N,K=map(int,input().split(" "))
H=[int(input()) for _ in range(N)]
H.sort()
tmax=10**9
for a in range(N-K+1):
    h1,h2=H[a],H[a+K-1]
    tmax=min(tmax,abs(h1-h2))
    if(tmax==0):
        break
print(tmax)
### BUGGY CODE ###

MAX = 10 ** 5 * 2
mod = 10 ** 9 + 7
frac = [1]
for i in range(1,MAX + 1 ):
    frac.append( (frac[-1] * i) % mod )
def pow(a, n):
    if n == 0 : return  1
    elif n == 1 : return a
    tmp = pow(a, n//2)
    tmp = (tmp * tmp) % mod
    if n % 2 == 1 :
        tmp = (tmp * a) % mod
    return tmp
def inv(x):
    return pow(x, mod - 2 )
def comb(n, k):
    if k >= n or k < 0 : return 1
    return (frac[n] * inv(frac[n-k]) * inv(frac[k]))%mod
n,k = map(int,input().split())
count=0
for i in range(min(n,k+1)):
    count=(count+comb(n,i)*comb(n-1,n-1-i))%mod
print(count)

### FIXED CODE ###

MAX = 10 ** 5 * 2
mod = 10 ** 9 + 7
frac = [1]
inv_frac=[1]
def pow(a, n):
    if n == 0 : return  1
    elif n == 1 : return a
    tmp = pow(a, n//2)
    tmp = (tmp * tmp) % mod
    if n % 2 == 1 :
        tmp = (tmp * a) % mod
    return tmp
def inv(x):
    return pow(x, mod - 2 )
for i in range(1,MAX + 1 ):
    frac.append( (frac[-1] * i) % mod )
    inv_frac.append(inv(frac[-1])%mod)
def comb(n, k):
    if k >= n or k < 0 : return 1
    return (frac[n]*inv_frac[n-k] * inv_frac[k]) %mod
n,k = map(int,input().split())
count=0
b=inv(n)
for i in range(min(n,k+1)):
    a=comb(n,i)
    count=(count+a*a*(n-i)*b)%mod
print(count)
### BUGGY CODE ###

S = input() 
Q = int(input())
process_list = [input().split() for i in range(Q)]  #[ [2, 1, p], [1], [2, 2, c], [1] ]

for lists in process_list:
    if lists[0] == "1":
        lists[0] = int(lists[0])
    if lists[0] == "2":
        lists[0] = int(lists[0])
        lists[1] = int(lists[1])

for lists in process_list:
    if lists[0] == 1:
        S = S[::-1]
    elif lists[0] == 2:
        if lists[1] == 1:
            S = lists[2] + S
        elif lists[1] == 2:
            S = S + lists[2]

print(S)

### FIXED CODE ###

S = input() 
Q = int(input())
rlist, llist = [], []
flag, cnt = 0, 0

def trans(f):
    if f == 1:
        f = 0
    elif f == 0:
        f = 1
    return f

def pros(f, r, add):
    if f == 0:
        if r == "1":
            llist.append(lists[2])
        elif r == "2":
            rlist.append(lists[2])
    elif f == 1:
        if r == "2":
            llist.append(lists[2])
        elif r == "1":
            rlist.append(lists[2])

for i in range(Q):
    lists = input().split()
    if lists[0] == "1":
        flag = trans(flag)
        cnt += 1
    else:
        pros(flag, lists[1], lists[2])
        
llist.reverse()
        
S = "".join(llist) + S + "".join(rlist)

if cnt % 2 == 1:
    S = S[::-1]
print(S)
### BUGGY CODE ###

#!/usr/bin/envpython
# -*- coding: utf-8 -*-

A, B  = map(int, raw_input().split())

while True:
	while A > 1:
		A -= 2
		B += 1
	else:
		if B == 0:
			print("Brown")
			break
	
	while B > 1:
		B -= 2
		A += 1
	else:
		if A == 0:
			print("Alice")
			break

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

A, B  = map(int, raw_input().split())

if abs(A - B) < 2:
	print("Brown")
else:
	print("Alice")
### BUGGY CODE ###

import numpy as np
INF = 10**10

def main():
    n, k = map(int, input().split())
    hs = np.array(list(map(int, input().split())))

    dp = [INF]*n
    dp[0] = 0
    dp = np.array(dp)

    for i in range(n):
        for j in range(1,k+1):
            if i+j < n:
                dp[i+j] = min(dp[i+j], dp[i]+abs(hs[i]-hs[i+j]))
    print(int(dp[-1]))

if __name__ == "__main__":
    main()

### FIXED CODE ###

INF = 10**10

def main():
    n, k = map(int, input().split())
    hs = list(map(int, input().split()))

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

    for i in range(1,n):
        from_ = max(i-k, 0)
        dp[i] = min(d + abs(hs[i]-h) for d, h in zip(dp[from_:i], hs[from_:i]))
    print(dp[-1])

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

# -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc141/tasks/abc141_d
import math
# 整数の入力
N, M = map(int, input().split())
A = list(map(int, input().split()))
if N > 1:
    for i in range(M):
        index = A.index(max(A))
        A[index] = math.floor(A[index] * 0.5)
else:
    A[0] = math.floor(A[0] * (1 / pow(2, M)))
print(sum(A))


### FIXED CODE ###

# -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc141/tasks/abc141_d
import heapq

# 整数の入力
N, M = map(int, input().split())
A = list(map(int, input().split()))

for i in range(N):
    A[i] *= -1

heapq.heapify(A)

for _ in range(M):
    heapq.heappush(A, ((heapq.heappop(A) * -1) >> 1) * -1)

print(sum(A) * -1)
### BUGGY CODE ###

l,r=map(int,input().split())
MOD= 2019 
if l-r>=2018:
    print(0)
    exit()
else:
    ltemp=l%MOD
    rtemp=r-l+ltemp
    ans=2019 
    for i in range(ltemp,rtemp):
        for j in range(i+1,rtemp+1):
            ans=min(ans,i*j%MOD)
    print(ans)

### FIXED CODE ###

l,r=map(int,input().split())
MOD= 2019 
if r-l>=2018:
    print(0)
    exit()
else:
    ltemp=l%MOD
    rtemp=r-l+ltemp
    ans=2019 
    for i in range(ltemp,rtemp):
        for j in range(i+1,rtemp+1):
            ans=min(ans,i*j%MOD)
    print(ans)
### BUGGY CODE ###

from operator import mul
from functools import reduce

N = int(input())
A = [int(i) for i in input().split(' ')]
if 0 in A:
    print(0)
else:
    goal = reduce(mul, A)
    if goal <= 10**18:
        print(goal)
    else:
        print(-1)

### FIXED CODE ###

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

N,Q=map(int,input().split())
s=input()
for i in range(Q):
    num=0
    l,r=map(int,input().split())
    while l<r:
        if s[l-1]+s[l]=="AC":
            num+=1
        l+=1
    print(num)

### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
LR = [list(map(int, input().split())) for _ in range(Q)]
dp = [0] * (N)
for i in range(N-1):
    if S[i] == 'A' and S[i+1] == 'C':
        dp[i+1] = dp[i] + 1
    else:
        dp[i+1] = dp[i]

for l, r in LR:
    print(dp[r-1] - dp[l-1])
### BUGGY CODE ###

N,M = map(int,input().split())
print([M//i for i in range(N,M+1) if(M%i==0)][0])

### FIXED CODE ###

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

m = M
f = {}
while m%2 == 0:
    f[2] = f.get(2,0) + 1
    m = m//2

k = 3
l = int(m**0.5)+1
while m != 1:
    if k > l:
        f[m] = f.get(m,0)+1
        break
    while m%k == 0:
        f[k] = f.get(k,0)+1
        m = m//k
    k += 2
C=[1]
for k in f:
    C_tmp = []
    for c in C:
        for i in range(f[k]):
            C_tmp.append(c*(k**(i+1)))
    C.extend(C_tmp)
ans_r = M
for c in C:
    if c>=N and c<ans_r:
        ans_r = c
print(M//ans_r)
### BUGGY CODE ###

N, K = map(int, input().split())
H = list(map(int, input().split()))
H = [0] + H
dp = [0] * (N + 1)
dp[1] = 0
dp[2] = abs(H[2] - H[1])

for i in range(3, N+1):
    a = 1000000000
    for j in range(max(1, i - K), i):
        a = min(a, dp[j] + abs(H[i] - H[j]))
    dp[i] = a

print(dp[N])

### FIXED CODE ###

N, K = map(int, input().split())
H = list(map(int, input().split()))
H = [0] + H
dp = [0] * (N + 1)
dp[1] = 0
dp[2] = abs(H[2] - H[1])

for i in range(3, N+1):
    dp[i] = dp[i - 1] + abs(H[i] - H[i - 1])
    for j in range(1, K + 1):
        if i - j <= 0:
            break
        dp[i] = min(dp[i], dp[i - j] + abs(H[i] - H[i - j]))
print(dp[N])
### BUGGY CODE ###

import math
k = int(input())
count = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            tmp = math.gcd(i,j)
            count += math.gcd(tmp,k)
print(count)

### FIXED CODE ###

import math
k = int(input())
count = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            tmp = math.gcd(i,j)
            count += math.gcd(tmp,k)
print(count)
### BUGGY CODE ###

import math
N,M,k = map(int,input().split())
p = N*M
X = math.factorial(p-2)
Y = math.factorial(p-k)
Z = math.factorial(k-2)
P = X//(Y*Z)
Q = N*(N-1)*(N+1)*M*M//6
R = M*(M-1)*(M+1)*N*N//6
print((P*(Q+R))%(10**9+7))

### FIXED CODE ###

import math
N,M,k = map(int,input().split())
p = N*M
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

P = cmb(p-2,k-2)
Q = N*(N-1)*(N+1)*M*M//6
R = M*(M-1)*(M+1)*N*N//6
print((P*(Q+R))%(10**9+7))
### BUGGY CODE ###

# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
# -*- coding: utf-8 -*-


class UnionFind:
    '''
    配列を用いたUnionFind
    '''

    def __init__(self, size):
        self.table = [i for i in range(size)]

    def find(self, x):
        '''
        xのグループ番号を返す
        '''
        return self.table[x]

    def union(self, x, y):
        '''
        xとyが同じグループならFalse
        xとyが違うグループなら、同じグループにする(くっつける)
        '''
        x1 = self.find(x)
        y1 = self.find(y)

        if x1 == y1:
            return False

        for i in range(len(self.table)):
            if self.table[i] == y1:
                self.table[i] = x1
        return True

    def same(self, x, y):
        '''
        xとyが同じグループならtrue
        '''
        x1 = self.find(x)
        y1 = self.find(y)
        return x1 == y1


N, M = map(int, input().split())
Un = UnionFind(N+1)
A = list(map(int, input().split()))

for _ in range(M):
    a, b = map(int, input().split())
    Un.union(a, b)

ans = 0
for i in range(N):
    if Un.same(A[i], i+1):
        ans += 1
print(ans)


### FIXED CODE ###

# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
# -*- coding: utf-8 -*-


class UnionFind:
    def __init__(self, size):
        self.parent = [i for i in range(size)]
        self.rank = [0 for _ in range(size)]

    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            return self.find(self.parent[x])

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
        else:
            self.parent[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        return self.find(x) == self.find(y)


N, M = map(int, input().split())
Un = UnionFind(N+1)
A = list(map(int, input().split()))

for _ in range(M):
    a, b = map(int, input().split())
    Un.union(a, b)

ans = 0
for i in range(N):
    if Un.same(A[i], i+1):
        ans += 1
print(ans)
### BUGGY CODE ###

import heapq 
# よく使うメソッドは以下
# q=heapq.heapify(List)：リスト→プライオリティキュー
# heapq.heappop(q)：プライオリティキュー q から最小要素を取り出す(O(log n))
# heapq.heappop(q,a)：プライオリティキュー q に要素を追加 O(log n))

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

A1,A2,A3=A[:N],A[N:2*N],A[2*N:]

res=[]
for k in range(N+1):
    qA=A1+A2[:k]
    heapq.heapify(qA)
    sumA=sum(qA)

    qB=A2[k:]+A3
    heapq.heapify(qB)
    sumB=0
    
    for n in range(N):
        sumB+=heapq.heappop(qB)
    for n in range(k):
        sumA-=heapq.heappop(qA)
    res.append(sumA-sumB)
print(max(res))

### FIXED CODE ###

import heapq 

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

A1,A2,A3=A[:N],A[N:2*N],A[2*N:]

res=[]
qA=A1
heapq.heapify(qA)
sumA=sum(qA)

qB=[-b for b in A3]
heapq.heapify(qB)
sumB=sum(qB)


resA,resB=[sumA],[sumB]
for k in range(N):
    heapq.heappush(qA,A2[k])
    a=heapq.heappop(qA)
    sumA+=A2[k]-a
    
    heapq.heappush(qB,-A2[N-(k+1)])
    b=heapq.heappop(qB)
    sumB+=-A2[N-(k+1)]-b
    resA.append(sumA)
    resB.append(sumB)

res=[resA[i]+resB[N-i] for i in range(N+1)]
print(max(res))
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(n):
    for j in range(n):
        if(a[j] == i + 1):
            ans.append(j+1)
for i in ans:
    print(i, end=' ')


### FIXED CODE ###

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

N, K, Q  = map(int, input().split())
win_list = [int(input()) for i in range(Q)]
score = [K for i in range(N)]

for x in win_list:
    for a, b in enumerate(score):
        if not a == x-1:
            score[a] = b-1

for s in score:
    if s > 0:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

N,K,Q = map(int,input().split())
A = list(int(input()) for _ in range(Q))

correct = [K-Q] * N

for i in range(Q):
    correct[A[i]-1] += 1

for i in correct:
    if i > 0:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

n, m = map(int, input().split())
ps = [input().split() for _ in range(m)]
 
a = []
wa = {}
AC_count = 0
WA_count = 0
for i in range(m):
    if ps[i][0] not in a:
        if ps[i][1] == 'AC':
            AC_count += 1
            if ps[i][0] in wa.keys():
                WA_count += wa[ps[i][0]]
            a.append(ps[i][0])
        else:
            if ps[i][0] in wa.keys():
                wa[ps[i][0]] += 1
            else:
                wa[ps[i][0]] = 1
print(AC_count, WA_count)

### FIXED CODE ###

n, m = map(int, input().split())
ps = [input().split() for _ in range(m)]

ps = sorted(ps, key=lambda x: x[0])

flag = 0
wa = {}
AC_count = 0
WA_count = 0
for i in range(m):
    if ps[i][0] != flag:
        if ps[i][1] == 'AC':
            AC_count += 1
            if ps[i][0] in wa.keys():
                WA_count += wa[ps[i][0]]
            flag = ps[i][0]
        else:
            if ps[i][0] in wa.keys():
                wa[ps[i][0]] += 1
            else:
                wa[ps[i][0]] = 1
print(AC_count, WA_count)
### BUGGY CODE ###

N = int(input())
MOD = 998244353

ans = 0
d = 1
b = 1
for i in range((N//2)):
    ans += d * b
    b *= 2
    b %= MOD
    ans %= MOD
    d = ((N-i)*d)%MOD
    d = (d*pow(i+1,MOD-2,MOD))%MOD

print((pow(3,N,MOD)-ans*2)%MOD)

### FIXED CODE ###

N = int(input())
MOD = 998244353

list_size = 10000010

f_list = [1] * list_size
f_r_list = [1] * list_size

for i in range(list_size - 1):
	f_list[i + 1] = int((f_list[i] * (i + 2)) % MOD)

f_r_list[-1] = pow(f_list[-1], MOD - 2, MOD)

for i in range(2, list_size + 1):
	f_r_list[-i] = int((f_r_list[-i + 1] * (list_size + 2 - i)) % MOD)


def conv(n,r):
    if r == 0:
        return 1
    return (((f_list[n - 1] * f_r_list[n - r - 1]) % MOD) * f_r_list[r - 1]) % MOD 

ans = 0
for i in range((N//2)):
    ans += conv(N,i) * pow(2,i,MOD)
    ans %= MOD

print((pow(3,N,MOD)-ans*2)%MOD)
### BUGGY CODE ###

from collections import deque

n = int(input())
que = deque()

for i in range(n):
    command = input()
    if command == "deleteFirst":
        que.popleft()
    elif command == "deleteLast":
        que.pop()
    elif command[0] == "i":
        que.appendleft(command[7:])
    else:
        try:
            que.remove(command[7:])
        except:
            pass
print(*que)

### FIXED CODE ###

import sys
from collections import deque

n = int(input())
que = deque()

for i in range(n):
    command = sys.stdin.readline()[:-1]
    if command[0] == "i":
        que.appendleft(command[7:])
    elif command[6] == " ":
        try:
            que.remove(command[7:])
        except:
            pass
    elif command[6] == "F":
        que.popleft()
    else:
        que.pop()
print(*que)