Harryxun/stf_run huggingface dataset:
import sys
from collections import defaultdict
# from collections import Counter
# from queue import PriorityQueue
# sys.setrecursionlimit(2000000)

def distance(X, Y, start, goal):
    ans = float('inf')

    tmp = goal - start
    if tmp < ans:
        ans = tmp

    # start ~ X ~ Y ~ goal,
    tmp = abs(X - start) + 1 + abs(goal - Y)
    if tmp < ans:
        ans = tmp

    # start ~ Y ~ X ~ goal
    tmp = abs(Y - start) + 1 + abs(goal - X)
    if tmp < ans:
        ans = tmp

    return min(ans)

#     # 短絡パスを使える場合
#     if start <= X and Y <= goal

#     # 短絡パスを使えないならば、普通に距離を計算
#     if X < start:
#         return goal - start

#     # 短絡パスを使えても、隣のパスへの距離は1
#     if goal - start == 1:
#         return 1

#     # 短絡パスより手前だと使えない
#     if goal < Y:
#         return goal - start



    # return goal - start - 1

def main():
    # N = int(input())

    N, X, Y = [int(s) for s in input().split()]

    distance_dict = defaultdict(int)
    for i in range(1, N+1):
        for j in range(i + 1, N+1):
            d = distance(X, Y, i, j)
            # sys.stderr.write('{} to {} : d = {}\n'.format(i, j, d))
            # ditance_dict[(i, j)] = d
            distance_dict[d] += 1

    for k in range(1, N):
        # print(str(distance_dict[k]))
        print(distance_dict[k])

    # As = []
    # Bs = []
    # for i in range(N):
    #     A, B = [int(s) for s in input().split()]
    #     As.append(A)
    #     Bs.append(B)

    return 0

if __name__ == '__main__':
    sys.exit(main())


### FIXED CODE ###

import sys
from collections import defaultdict
# from collections import Counter
# from queue import PriorityQueue
# sys.setrecursionlimit(2000000)

def distance(X, Y, start, goal):
    ans = float('inf')

    tmp = goal - start
    if tmp < ans:
        ans = tmp

    # start ~ X ~ Y ~ goal,
    tmp = abs(X - start) + 1 + abs(goal - Y)
    if tmp < ans:
        ans = tmp

    # start ~ Y ~ X ~ goal
    tmp = abs(Y - start) + 1 + abs(goal - X)
    if tmp < ans:
        ans = tmp

    return ans

#     # 短絡パスを使える場合
#     if start <= X and Y <= goal

#     # 短絡パスを使えないならば、普通に距離を計算
#     if X < start:
#         return goal - start

#     # 短絡パスを使えても、隣のパスへの距離は1
#     if goal - start == 1:
#         return 1

#     # 短絡パスより手前だと使えない
#     if goal < Y:
#         return goal - start



    # return goal - start - 1

def main():
    # N = int(input())

    N, X, Y = [int(s) for s in input().split()]

    distance_dict = defaultdict(int)
    for i in range(1, N+1):
        for j in range(i + 1, N+1):
            d = distance(X, Y, i, j)
            # sys.stderr.write('{} to {} : d = {}\n'.format(i, j, d))
            # ditance_dict[(i, j)] = d
            distance_dict[d] += 1

    for k in range(1, N):
        # print(str(distance_dict[k]))
        print(distance_dict[k])

    # As = []
    # Bs = []
    # for i in range(N):
    #     A, B = [int(s) for s in input().split()]
    #     As.append(A)
    #     Bs.append(B)

    return 0

if __name__ == '__main__':
    sys.exit(main())
from math import floor, sqrt
from collections import defaultdict
def factors(n):
    d = defaultdict(int)
    for i in range(2,floor(sqrt(n))+1):
        while n % i == 0:
            n //= i
            d[i] += 1
        if n == 1:
            break
    if n != 1:
        d[n] += 1
    return d
def inv(x, mod):
    k = mod - 2
    ret = 1
    while k > 0:
        if k&1:
            ret = (ret*x) % mod
        x = (x*x) % mod
        k >>= 1
    return ret
N, M = map(int,input().split())
mod = 10**9+7
dic = factors(M)
K = len(dic)
SIZE = N+max(dic.values())
fact = [None]*(SIZE+1)
finv = [None]*(SIZE+1)
fact[0] = 1
for i in range(1,SIZE+1):
    fact[i] = (fact[i-1]*i) % mod
finv[SIZE] = inv(fact[SIZE], mod=mod)
for i in range(SIZE, 0, -1):
    finv[i-1] = (finv[i]*i) % mod
def comb(n,k):
    tmp = (finv[k]*finv[n-k]) % mod
    return (fact[n]*tmp) % mod
ans = 1
for p in dic:
    ans = (ans*comb(dic[p]+N-1, dic[p])) % mod
print(ans)

### FIXED CODE ###

from math import sqrt, floor
from collections import defaultdict
def comb(n,m):
    if m == 0:
        return 1
    return comb(n-1,m-1)*n // m
def facts(n):
    dic = defaultdict(int)
    for i in range(2,floor(sqrt(n))+1):
        while n % i == 0:
            n //= i
            dic[i] += 1
        if n == 1:
            break
    if n != 1:
        dic[n] += 1
    return dic
N, M = map(int,input().split())
mod = 10**9+7
ans = 1
dic = facts(M)
for p in dic:
    ans = (ans*(comb(dic[p]+N-1, dic[p]) % mod)) % mod
print(ans)
# coding: utf-8
 
pre_list = list(input().rstrip().split(" "))
N = pre_list[0]
A = pre_list[1]
N = pre_list[2]
 
S  = input()
 
for i in range(N):
    if S[i] == "c":
        print("No")
    elif S[i] == "a":
        if i < A+B:
            print("Yes")
        else:
            print("No")
    elif S[i] == "b":
        if i < B:
            print("Yes")
        else:
            print("No") 

### FIXED CODE ###

N, A, B = map(int, input().split())
S = input()
count = 0
count2 = 0


for i in range(N):
    if S[i] == "c":
        print("No")
    elif S[i] == "a":
        
        if count < A+B:
            print("Yes")
            count += 1
        else:
            print("No")
    elif S[i] == "b":
        
        if count < A+B and count2 < B:
            print("Yes")
            count += 1
            count2 += 1
        else:
            print("No")
a = input()
    print('ARC')
elif a == 'ARC':
    print('ABC')

### FIXED CODE ###

a = input()

if a == 'ABC':
    print('ARC')
elif a == 'ARC':
    print('ABC')
r = int(iinput())
print(r*r)

### FIXED CODE ###

r = int(input())
print(r*r)
n=int(input())

num=0

t,x,y=map(int,input().split())
num+=(x+y)
if t%num!=0:
  print("NO")
  exit()
  
for i in range(n-1):
  t,x,y=map(int,input().split())
  num-=(x+y)
  num=abs(num)
  if t%num!=0:
    print("NO")
    exit()
    
print("YES")
  

### FIXED CODE ###

n=int(input())

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num>=su and num%2 == su%2:
    ans="Yes"
  else:
    ans="No"
    break
      
print(ans)
"""
F = [1,1]
def fibo(n):
    if n <= len(F):
        return F[n-1]
    while len(F) < n:
        F.append(F[-1] + F[-2])
    return F[n-1]
"""

N, M = list(map(int, input().split()))
A = [int(input()) for _ in range(M)]
MOD = 1000000007

B = [A[0]]
for i in range(M-1):
    B.append(A[i+1] - A[i] - 1)
B.append(N - A[M-1])
ans = 1
if 0 in B:
    ans = 0
else:
    F = [1,1]
    for n in B:
        while len(F) < n:
            F.append(F[-1] + F[-2])
        now = F[n-1]
        ans = ans * now % MOD
print(ans)


### FIXED CODE ###

"""
F = [1,1]
def fibo(n):
    if n <= len(F):
        return F[n-1]
    while len(F) < n:
        F.append(F[-1] + F[-2])
    return F[n-1]
"""

N, M = list(map(int, input().split()))
A = [int(input()) for _ in range(M)]
MOD = 1000000007

if M == 0:
    B = []
    B.append(N+1)
elif M == 1:
    B = []
    B.append(A[0])
    B.append(N - A[0])

else:
    B = [A[0]]
    for i in range(M-1):
        B.append(A[i+1] - A[i] - 1)
    B.append(N - A[M-1])


ans = 1
if 0 in B:
    ans = 0
else:
    F = [1,1]
    for n in B:
        while len(F) < n:
            F.append(F[-1] + F[-2])
        now = F[n-1]
        ans = ans * now % MOD
print(ans)
A=list(map(int,input().split()))
count=0
while len(A) !=0:
  count+=1
  while count_sub < A.count(A[0]):
    A=A.remove(A[0])
    count_sub+=1
print(count)

### FIXED CODE ###

N=int(input())
z=[]
for num in range(101):
  z.append(0)
counter=0
while counter < N:
  d=int(input())
  z[d]=1
  counter+=1
result=sum(z)
print(result)
M=[]
for _i in range(3):
  M.append(list(map(int,input().split())))
n= int(input())
for a in range(n):
  b= int(input())
  for i in range(3):
    for j in range(3):
      if M[i][j]==b:
        M[i][j]=-1
oassiy= False
for i in range(3):
  cont=0
  for j in range(3):
    if M[i][j]==-1:
      cont+=1
  if cont==3:
    break
    oassiy=True

if not oassiy:
 for j in range(3):
  cont=0
  for i in range(3):
    if M[i][j]==-1:
      cont+=1
  if cont==3:
    break
    oassiy=True

if not oassiy:
  cont1 = cont2= 0
  for i in range(3):
    if M[i][i]==-1:
      cont1+=1
    if M[i][2-i]==-1:
      cont2+=1
if (cont1==3) or (cont2==3):
    oassiy=True

print('Yes' if oassiy else 'No')


### FIXED CODE ###

n= int(input())
if n%2==0:
  print(n//2)
else:
  print(n//2+1)
import math
 
n = input()
 
if n[len(n)] == 3:
  print("bon")
elif n[len(n)] == 0 or n[len(n)] == 1 or n[len(n)] == 0 or  n[len(n)] == 6 or n[len(n)] == 8:
  print("pon")
else:
  print("hon")
 

### FIXED CODE ###

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

import sys


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


def resolve():
    n = input().rstrip()

    if n[-1] == "3":
        print("bon")
    elif n[-1] == "2" or n[-1] == "4" or n[-1] == "5" or n[-1] == "7" or n[-1] == "9":
        print("hon")
    else:
        print("pon")


if __name__ == "__main__":
    resolve()
N=int(input())
P=[1]+list(map(int,input().split()))

ans=0
for i in range(1,N+1):
    if P[i]==i:
        if i+1==P[i+1] or i==1:
            P[i+1],P[i]=P[i],P[i+1]
            ans+=1
        else:
            P[i-1],P[i]=P[i],P[i-1]
            ans+=1
print(ans)

### FIXED CODE ###

N=int(input())
P=[1]+list(map(int,input().split()))

ans=0
for i in range(1,N+1):
    if P[i]==i:
        if (i<N and i+1==P[i+1]) or i==1:
            P[i+1],P[i]=P[i],P[i+1]
            ans+=1
        else:
            P[i-1],P[i]=P[i],P[i-1]
            ans+=1
print(ans)
n,k=map(int,input().split())
ls={}
for i in range(n):
  a,b=map(int,input().split())
  if a not in ls:
    ls[a]=b
  else:
    ls[a]+=b
ls=sorted(ls.keys())
tmp=0
for i,j in ls.items():
  tmp+=j
  if k <= tmp:
    print(i)
    exit()

### FIXED CODE ###

n,k=map(int,input().split())
ls={}
for i in range(n):
  a,b=map(int,input().split())
  if a not in ls:
    ls[a]=b
  else:
    ls[a]+=b
ls=sorted(ls.items())
tmp=0
for i,j in ls:
  tmp+=j
  if k <= tmp:
    print(i)
    exit()
N = int(input())
D, X = map(int, input().split())

A = []
for _ in range(N):
    A.append(int(input()))

ans = X

for i in range(1, D+1):
    for j in A:
        if j == 1:
            ans += 1
        eliaf i % j == 1:
            ans += 1

print(ans)

### FIXED CODE ###

N = int(input())
D, X = map(int, input().split())

A = []
for _ in range(N):
    A.append(int(input()))

ans = X

for i in range(1, D+1):
    for j in A:
        if j == 1:
            ans += 1
        elif i % j == 1:
            ans += 1

print(ans)
from collections import deque

N, M = map(int, input().split())
graph = [[] for j in range(M)]
q = deque([])
depth_array = [-1 for i in range(N)]

for i in range(M):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

def bfs(graph, q, depth_array):
    # 終了条件
    if len(q) == 0:
        return depth_array

    cur_room = q.popleft()

    # キューに追加
    for r in graph[cur_room]:
        if depth_array[r] == -1: #未訪問なら
            q.append(r)
            depth_array[r] = depth_array[cur_room] + 1

    return bfs(graph, q, depth_array)
    
# init
q.append(0)
depth_array[0] = 0
depth_array = bfs(graph, q, depth_array)

mark_array = [-1 for i in range(N)]
#print(depth_array)

for room, depth in enumerate(depth_array):
    for node in graph[room]:
        if depth_array[node] + 1 == depth_array[room]:
            mark_array[room] = node
if -1 in mark_array[1:]:
    print("No")
else:
    print("Yes")
    for m in mark_array[1:]:
        print(m+1)

### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(200000)
N, M = map(int, input().split())
graph = [[] for j in range(N)]
q = deque([])
depth_array = [-1 for i in range(N)]

for i in range(M):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

def bfs(graph, q, depth_array):
    # 終了条件
    if len(q) == 0:
        return depth_array

    cur_room = q.popleft()

    # キューに追加
    for r in graph[cur_room]:
        if depth_array[r] == -1: #未訪問なら
            q.append(r)
            depth_array[r] = depth_array[cur_room] + 1

    return bfs(graph, q, depth_array)
    
# init
q.append(0)
depth_array[0] = 0
depth_array = bfs(graph, q, depth_array)

mark_array = [-1 for i in range(N)]
#print(depth_array)

for room, depth in enumerate(depth_array):
    for node in graph[room]:
        if depth_array[node] + 1 == depth_array[room]:
            mark_array[room] = node

if -1 in mark_array[1:]:
    print("No")
else:
    print("Yes")
    for m in mark_array[1:]:
        print(m+1)
a,b=map(int,input().split())
height=list(map(int,input().split()))
count=0
for i in range (a):
  	 if int(height[i])>=b:
      	count+=1
print(count)

### FIXED CODE ###

a,b=map(int,input().split())
height=list(map(int,input().split()))
count=0
for i in range (a):
    if int(height[i])>=b:
       count+=1
print(count)
n = int(input())
if n < 105:
  print(0)
else:
  ans = 0
  for i in range(n,103,-2):
    count = 1
    for j in range(1,99,2):
      nj = n%j
      if nj == 0:
        count += 1
      if count == 9:
        ans -= 1
    if count == 8:
      ans += 1
print(ans)

### FIXED CODE ###

a, b = map(int,input().split())
print((a-1)*(b-1))
n, Y = map(int, input().split())
for x in range(n):
    for y in range(n-x):
        z = n-x-y
        if (x*10000 + y*5000 + z*1000) == Y:
            print(x, y, z)
            a = 1
            break
if a != 1:
    print(-1, -1, -1)

### FIXED CODE ###

n, Y = map(int, input().split())
a = 0
for x in range(n+1):
    for y in range(n-x+1):
        z = n-x-y
        if (x*10000 + y*5000 + z*1000) == Y:
            print(x, y, z)
            a = 1
            break
    if a == 1:
        break
if a != 1:
    print(-1, -1, -1)
N,K = map(int, input().split())
A =[0]
B=list(map(int, input().split()))
for m in range(N):
    A.append(B[m])
place=set([])
p=[]
i=1
count=0
while i not in place:
    place.add(i)
    p.append(i)
    i=A[i]
    count+=1
if count>=K:
    print(p[K+1])
else:
    loop=[i]
    start=i
    j=A[i]
    count+=1
    while j!=start:
        loop.append(j)
        j=A[j]
        count+=1
    num=(K-count)%len(loop)
    print(loop[num])

### FIXED CODE ###

N,K = map(int, input().split())
A =[0]
B=list(map(int, input().split()))
for m in range(N):
    A.append(B[m])
place=set([])
p=[]
i=1
count=0
while i not in place:
    place.add(i)
    p.append(i)
    i=A[i]
    count+=1
if count>K:
    print(p[K])
else:
    loop=[i]
    start=i
    j=A[i]
    count+=1
    while j!=start:
        loop.append(j)
        j=A[j]
        count+=1
    if count>K:
        print(loop[K-len(p)])
    else:
        num=(K-count)%len(loop)
        print(loop[num])
s = input()
z = int(input())
list = [chr(i) for i in range(97,97+26)]
d = []
flag = 0
for j in list:
  indexes = [i for i,x in enumerate(s) if x==j]
  if len(indexes)==0:
    continue
  for k in indexes:
    for l in range(len(s)-k):
      d.append(s[k:l+k+1])
  if len(d)==k:
    break
print(sorted(set(d))[z-1])

### FIXED CODE ###

s = input()
z = int(input())
list = [chr(i) for i in range(97,97+26)]
d = []
for j in list:
  indexes = [i for i,x in enumerate(s) if x==j]
  if len(indexes)==0:
    continue
  for k in indexes:
    for l in range(len(s)-k):
      d.append(s[k:l+k+1])
      if len(s[k:l+k+1])==z:
        break
print(sorted(set(d))[z-1])
a, b, c = list(map(int, input().split()))

if (a + b + c == 17) && (a * b * c == 5 * 5 * 7):
    print("YES")
else:
    print("NO")

### FIXED CODE ###

a, b, c = list(map(int, input().split()))

if (a + b + c == 17) and (a * b * c == 5 * 5 * 7):
    print("YES")
else:
    print("NO")
N = int(input())
S_list = []
for i in range(N):
    x = input()
    S_list.append(x)
another_list = [S_list[0]]
cnt_list = [1]
for i in range(1, N):
    for j in range(len(another_list)):
        if another_list[j] == S_list[i]:
            cnt_list[j] += 1
            break
    if j == len(another_list)-1:
        another_list.append(S_list[i])
        cnt_list.append(1)
max_v = max(cnt_list)
cnt = []
for i in range(len(cnt_list)):
    if max_v == cnt_list[i]:
        cnt.append(i)
cnt1 = []
for i in range(len(cnt)):
    cnt1.append(another_list[cnt[i]])
if len(cnt1) > 2:
    for _ in range(len(cnt1)-1):
        for i in range(len(cnt1)-1):
            tmp = "s"
            if ord(cnt1[i][0]) > ord(cnt1[i+1][0]):
                tmp = cnt1[i+1][0] 
                cnt1[i+1][0] = cnt1[i][0]
                cnt1[i][0] = tmp
print(cnt1)


### FIXED CODE ###

N = int(input())
S_dic = {}
for i in range(N):
    S = input()
    if S in S_dic:
        S_dic[S] += 1
    else:
        S_dic[S] = 1
max_v = max(S_dic.values())
ans_list = [key for key, val in S_dic.items() if val == max_v]
ans_list.sort()
print("\n".join(ans_list))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
b.sort()

P = a[1] - 1 

list = list(map(lambda x: x+1, list(range(b[P]))))

if a[1] == 0:
  print(a[0])
  exit()

for i in range(a[1]):
  list.remove(b[i])

num = 0

result = []

for i in range(a[1]):
  x = a[0] - b[num]
  result.append(abs(x))
  num += 1

print(min(result))

### FIXED CODE ###

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

if N == 0:
  print(X)
  exit()
else:
  P = list(map(int,input().split()))

  for i in range(100):
    if (X-i) not in P:
      print(X-i)
      break
    elif (X+i) not in P:
      print(X+i)
      break
N = int(input())
A = [int(k) for k in input().split(' ')]

from collections import Counter 
import math 

res = [] # solution for each key in A
res_list = {} # solution for each value in A

# counter ver
A_c = Counter(A)
l = len(A_c)

def ncr(j):
  return j * (j-1) // 2 if j >= 2 else 0

# store ncr for each value 
combs = {k: ncr(v) for k, v in A_c.items()}

s = sum(combs.values())
  
for m in A_c.keys():
  res_list[m] = s - combs[m] + ncr(A_c[m] - 1)

for k in range(N):
  res.append(res_list[A[k]])
print('\n'.join([str(s) for s in res]))

### FIXED CODE ###

M, N = [int(k) for k in input().split(' ')]
import math 
res = 0

if N >= 2:
  res += (math.factorial(N) // math.factorial(2) // math.factorial(N - 2))

if M >= 2:
  res += (math.factorial(M) // math.factorial(2) // math.factorial(M - 2))

print(res)
n = int(input())
a = list(map(int,input().split()))
d = [0]

for i in range(n):
    d.append(d[i] ;a[i])

ans = d[-1]

for i in range(n):
    ans =min(ans,abs(d[-1] -2*d[i]))
print(ans)


### FIXED CODE ###


n = int(input())
a = list(map(int,input().split()))
d = [0]

for i in range(n):
    d.append(d[i] + a[i])

ans = d[-1]

for i in range(n):
    ans =min(ans,abs(d[-1] -2*d[i]))
print(ans)
S=list(input())
yes_flag=0
in_flag=0

for i in range(int(len(S)/2)):
  #print(S)
  if S[0:5] == list("erase"):
    in_flag=1
    del S[0:5]
    if S[0] == "r":
      del S[0]
    if len(S) == 0:
      yes_flag=1
      break
  if S[0:5] == list("dream"):
    in_flag=1
    del S[0:5]
    if S[0:2] == list("er"):
      if not len(S) == 2:
      	if not S[2] == "a":
          del S[:2]
      else :
        del S[:2]
    if len(S) == 0:
      yes_flag=1
      break
  
  if in_flag==0:
    break
  in_flag=0

if yes_flag == 1:
  print("YES")
else :
  print("NO")

### FIXED CODE ###

import re
print("YES" if re.match("^(dream|dreamer|erase|eraser)+$",input()) else "NO")
num = int(input())
print(min(i + num // i - 2 for i in range(1, int(num ** (1 / 2))) if not num % i))

### FIXED CODE ###

num = int(input())
print(min(i + num // i - 2 for i in range(1, int(num ** (1 / 2)) + 1) if not num % i))
s=list(input())
x,y = map(int, input().split())
s.append('T')
x1=[]
y1=[]

count=0
u=0
for i in range(len(s)):
    if s[i]=='F':
        count+=1
    else:
        if u%2==0:
            x1.append(count)
            u+=1
            count=0
        else:
            y1.append(count)
            u+=1
            count=0

if (len(x1)<=1 and x1[0]!=x) or (len(y1)==0 and y1[0]!=y):
    print('No')
    exit()

dpx=[[0 for i in range(sum(x1)*2+2)] for j in range(len(x1)+1)]
if len(x1)>=2:
    dpx[1][0]=1
for i in range(1,len(x1)):
    for j in range(-(sum(x1))-1,sum(x1)+1):
        dpx[i + 1][j] = dpx[i][j - x1[i]] or dpx[i][j+x1[i]]

dpy=[[0 for i in range(sum(y1)*2+2)] for j in range(len(y1)+1)]

dpy[0][0]=1

for i in range(len(y1)):
    for j in range(-sum(y1)-1,sum(y1)+1):
        dpy[i + 1][j] = dpy[i][j - y1[i]] or dpy[i][j+y1[i]]


if dpy[len(y1)][y]==1 and dpx[len(x1)][x-x1[0]]==1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import sys
input = sys.stdin.readline
s=list(input())
x,y = map(int, input().split())
y=abs(y)
s.append('T')
x1=[]
y1=[]

count=0
u=0
for i in range(len(s)):
    if s[i]=='F':
        count+=1
    else:
        if u%2==0:
            x1.append(count)
            u+=1
            count=0
        else:
            y1.append(count)
            u+=1
            count=0
v=sum(x1)
w=sum(y1)
v-=x1[0]
x-=x1[0]
x1.pop(0)
x=abs(x)
if v<x or w<y:
    print('No')
    exit()

dpx=[[0 for i in range(v+1)] for j in range(len(x1)+1)]
dpx[0][-1]=1

for i in range(len(x1)):
    for j in range(v+1):
        if dpx[i][j]==1:
            if j-2*x1[i]>=0:
                dpx[i+1][j-2*x1[i]]=1
            dpx[i+1][j]=1

if len(y1)==0:
    y1.append(0)
dpy=[[0 for i in range(w+1)] for j in range(len(y1)+1)]
dpy[0][-1]=1

for i in range(len(y1)):
    for j in range(w+1):
        if dpy[i][j]==1:
            if j-2*y1[i]>=0:
                dpy[i+1][j-2*y1[i]]=1
            dpy[i+1][j]=1

if dpy[-1][y]==1 and dpx[-1][x]==1:
    print('Yes')
else:
    print('No')
l=[list(map(int,input().split())) for i in range(3)]
x=l[0][0],y=l[0][1],z=l[0][2]
a=0,b=l[1][0]-x,c=l[2][0]-x
if b+y==l[1][1] and b+z==l[1][2] and c+y==l[2][1] and c+z==l[2][2]:
  print('Yes')
else:
  print('No')
  

### FIXED CODE ###

l=[list(map(int,input().split())) for i in range(3)]
x=l[0][0]
y=l[0][1]
z=l[0][2]
a=0
b=l[1][0]-x
c=l[2][0]-x
if b+y==l[1][1] and b+z==l[1][2] and c+y==l[2][1] and c+z==l[2][2]:
  print('Yes')
else:
  print('No')
name=input()
if name<=999:
    print('ABC')
elif name>=1000:
    print('ABD')
else:
    print()


### FIXED CODE ###

name=int(input())
if name>=1000:
    print('ABD')
else:
    print('ABC')
import sys
input=sys.stdin.readline

def calc():
  mod=998244353
  n,s=map(int,input().split())
  arr=list(map(int,input().split()))
  dp=[[[0]*(s+1) for _ in range(n+1)] for _ in range(n+1)]
  dp[0][0][0]=1
  for i in range(1,n+1):
    val=arr[i-1]
    for j in range(i,-1,-1):
      for k in range(s,val-1,-1):
        dp[i][j][k]=dp[i-1][j][k]%mod
        dp[i][j][k]+=dp[i-1][j-1][k-val]
      for k in range(val-1,-1,-1):
        dp[i][j][k]=dp[i-1][j][k]%mod
  ans=0
  for i in range(1,n+1):
    ans+=dp[n][i][s]*pow(2,n-i,mod)
    ans%=mod
  print(ans)
calc()

### FIXED CODE ###

import sys
input=sys.stdin.readline

def calc():
  mod=998244353
  n,s=map(int,input().split())
  arr=list(map(int,input().split()))
  dp=[0]*(s+1)
  dp[0]=1
  ans=0
  for i in range(1,n+1):
    val=arr[i-1]
    for k in range(s,-1,-1):
      dp[k]*=2
      dp[k]%=mod
      if k>=val and dp[k-val]!=0:
        dp[k]+=dp[k-val]
        dp[k]%=mod
  print(dp[s]%mod)
calc()