Harryxun/stf_run huggingface dataset:
import itertools as it
def erat():
    D = {9:3, 25:5}
    yield from [2, 3, 5]
    MASK = [1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0]
    MODULOS = (1, 7, 11, 13, 17, 19, 23, 29) 

    for q in it.compress(
            it.islice(it.count(7), 0, None, 2),
            it.cycle(MASK)):
        p = D.pop(q, None)
        if p is None:
            D[q*q] = q
            yield q
        else:
            x = q + 2*p
            while x in D or (x%30) not in MODULOS:
                x += 2*p
            D[x] = p


n = int(input())
l = 0
ans = []
for k in erat():
    if k % 5 == 1:
        buf.append(k)
        l += 1
        if l >= n:
            break
print(*ans)


### FIXED CODE ###

import itertools as it
def erat():
    D = {9:3, 25:5}
    yield from [2, 3, 5]
    MASK = [1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0]
    MODULOS = (1, 7, 11, 13, 17, 19, 23, 29) 

    for q in it.compress(
            it.islice(it.count(7), 0, None, 2),
            it.cycle(MASK)):
        p = D.pop(q, None)
        if p is None:
            D[q*q] = q
            yield q
        else:
            x = q + 2*p
            while x in D or (x%30) not in MODULOS:
                x += 2*p
            D[x] = p


n = int(input())
l = 0
ans = []
for p in erat():
    if p % 5 == 1:
        ans.append(p)
        l += 1
        if l >= n:
            break
print(*ans)
N = int(input())
H = list(map(int,input().split()))

memo = {1:0,2:abs(H[1]-H[0])}
def K(n):
  if n in memo.keys():
    return memo[n]
  memo[n] = min(K(n-2)+abs(H[n]-H[n-2]),K(n-1)+abs(H[n]-H[n-1]))
  return memo[n]

print(K(N-1))

### FIXED CODE ###

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

dp = [0]*N
for i in range(N):
  if i == 0:
    dp[i] = 0
  elif i == 1:
    dp[i] = abs(H[i]-H[i-1])
  else:
    dp[i] = min((dp[i-1]+abs(H[i]-H[i-1])),dp[i-2]+abs(H[i]-H[i-2]))
print(dp[-1])
n = int(input())
lst = []

for i in range(n):
  item = int(input())
  goods.append(item)

goods = sorted(lst, reverse=True)
goods[0] = goods[0] // 2

print(sum(goods))


### FIXED CODE ###

d = int(input())
eve  = 25 - d

print("Christmas" + " Eve" * eve)
import math
from functools import reduce

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



reduce(math.gcd, al)



### FIXED CODE ###

import fractions
from functools import reduce

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

print(reduce(fractions.gcd, al))
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
for _ in range(n):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if a[i][j] == b:
                a[i][j]=-1
for i in range(3):
    if a[i][0]==a[i][1]==a[i][2]==-1:
        print('Yes')
        exit()
    if a[0][i]==a[1][i]==a[2][i]==-1:
        print('Yes')
        exit()
if a[0][0]==a[1][1]==a[2][2]==-1 or a[0][2]==a[1][1]==a[2][0]==-1:
    print('Yes')
    exit()
print('No')

### FIXED CODE ###

N = int(input())
if N %2 == 0:
    print(int(N/2))
else:
    print(N//2 + 1)
N, M = map(int, input().split())

l = [list(input().split()) for _ in range(M)]

answers = {}
wrongs = {}

for a in l:
    if a[1] == "AC":
        answers[a[0]] = a[1]
    elif a[1] == "WA":
        if not a[0] in answers:
            if a[0] in wrongs:
                wrongs[a[0]] = wrongs[a[0]] + 1
            else:
                wrongs[a[0]] = 1


# 集計
result = [len(answers.keys()), sum(wrongs.values())]

print(result[0], result[1])



### FIXED CODE ###

C = input()
letters = "abcdefghijklmnopqrstuvwxyz"
list_letters = list(letters)
print(list_letters[letters.find(C)+1])
S = list(input())
invS = []
for s in reversed(S):
    invS.append(s)
cnt = 0
loop = 0
i,j = 0,0
while i <= len(S)//2+1 and j <= len(S)//2+1:
    if S[i] == invS[j]:
        i += 1
        j += 1
    elif S[i] == "x":
        cnt += 1
        i += 1
    elif invS[j] == "x":
        cnt += 1
        j += 1
    loop += 1
    if loop > len(S):
        cnt = -1
        break
print(cnt)


### FIXED CODE ###

S = list(input())
invS = []
for s in reversed(S):
    invS.append(s)
cnt = 0
loop = 0
i,j = 0,0
while i+j < len(S)-1 and i <= len(S)-1 and j <= len(S)-1 :
    if S[i] == invS[j]:
        i += 1
        j += 1
    elif S[i] == "x":
        cnt += 1
        i += 1
    elif invS[j] == "x":
        cnt += 1
        j += 1
    else:
        cnt = -1
        break
print(cnt)
M, D=map(int,input()>split())
if D>=M:
  print(M)
elif:
  print(M-1)

### FIXED CODE ###

M, D=map(int,input().split())
if D>=M:
  print(M)
else:
  print(M-1)
x,y = map(int,input().sprit())
k = "NO"
for i in range(x+1):
  b=x-i
  if i*4+b*2==y:
    k="YES"
print(k)

### FIXED CODE ###

x,y = map(int,input().split())
k = "No"
for i in range(x+1):
  b=x-i
  if (b*4)+(i*2)==y:
    k="Yes"
print(k)
n,k = [int(x) for x in input().split()]
s = input()

s[k].lower()

print(s)

### FIXED CODE ###

n,k = [int(x) for x in input().split()]
s = input()

print(s[:k-1] + s[k-1].lower() + s[k:])
#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;

typedef long long ll;
typedef long double ld;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

char tochr(int n){return (char)('a' + n);}
int tonum(char c){return (int)(c) - 97;}

int main(){
	ll n;
	cin >> n; 
	deque<int> ans;
	while(n){
		n --;
		ll dig = n % 26;
		n /= 26;
		ans.push_front(dig);
	}
	for(int n: ans){
		cout << tochr(n % 26);
	}
}


### FIXED CODE ###

from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict, Counter
import math

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())
rlf = lambda: map(float, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

tonum = lambda c: ord(c) - 97
tochr = lambda num: chr(num + 97)

def to26(n):
	ans = deque()
	while n:
		n -= 1
		n, dig = divmod(n, 26)
		ans.appendleft(dig)
	return ans

def main():
	n = int(rl())
	ans = [tochr(x) for x in to26(n)]
	print("".join(x for x in ans))
	stdout.close()

if __name__ == "__main__":
	main()
s = list(input())
K = int(input())
alphabet = "abcdefghijklmnopqrstuvwxyz"

# need = 0
# for i in range(len(s)):
#     need += ord("z") - ord(s[i]) + 1

for i in range(len(s)):
    if K >= 26 or s[i] >= alphabet[-K]:
        K -= ord("z") - ord(s[i]) + 1
        s[i] = "a"

if K > 0:
    K %= 26
    if (ord(s[-1]) + K <= ord("z")):
        s[-1] = chr(ord(s[-1]) + K)
    else:
        s[-1] = chr(ord("a") + K - (ord("z" - ord(s[-1]))))

print("".join(s))

### FIXED CODE ###

s = list(input())
s.insert(4, " ")
print("".join(s))
N, Q = map(int,input().split())
graph = [[] for _ in range(N+1)]
point = [0] * (N+1)
for _ in range(N-1):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)
for _ in range(Q):
    p, x = map(int, input().split())
    point[p] += x

# dfsをします。
def dfs(x, parent):
    point[x] += point[parent]
    for i in range(len(graph[x])):
        if graph[x][i] == parent:
            continue
        dfs(graph[x][i], x)
dfs(1, 0)
point_str = [str(n) for n in point]
ans = ' '.join(point_str[1:])
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
N, Q = map(int,input().split())
graph = [[] for _ in range(N+1)]
point = [0] * (N+1)
for _ in range(N-1):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)
for _ in range(Q):
    p, x = map(int, input().split())
    point[p] += x

# dfsをします。
def dfs(x, parent):
    point[x] += point[parent]
    for i in range(len(graph[x])):
        if graph[x][i] == parent:
            continue
        dfs(graph[x][i], x)
dfs(1, 0)
point_str = [str(n) for n in point]
ans = ' '.join(point_str[1:])
print(ans)
import math
list = map(input().split())
ans = float(list[1])*int(list[0])
print(math.floor(ans))

### FIXED CODE ###

a,b = input().split()
a = int(a)
b = round(100*float(b))
print(a*b//100)
xyz=input().split()
a=int(xyz[0])
b=int(xyz[1])
c=int(xyz[2])
s=[]
d=[]
flag=0
if a==1 and b==1 and c==1:
  flag=1
for i in range(1,max(a,b)):
  if a%i==0 and b%i==0:
    s.append(i)
s.sort()
s.reverse()
if flag==0:
  print(s[c-1])
else:
  print(1)

### FIXED CODE ###

a,b,k=map(int,input().split())
z=min(a,b)
n=0
while(z>=1):

    if(a%z==0 and b%z==0):
        n+=1;
        if n==k:
            break
    z-=1

print(z)
S=input()
a=int(S[0]+S[1])
b=int(S[2]+S[3])
if (a==0 a>12) and 0<b<=12:
    print("YYMM")
elif 0<a<=12 and 0<b<=12:
    print("AMBIGUOUS")
elif 0<a<=12 and b>12:
    print("MMYY")
else:
    print("NA")

### FIXED CODE ###

S=input()
a=int(S[0]+S[1])
b=int(S[2]+S[3])
if (a==0 or a>12) and 0<b<=12:
    print("YYMM")
elif 0<a<=12 and 0<b<=12:
    print("AMBIGUOUS")
elif 0<a<=12 and (b==0 or b>12):
    print("MMYY")
else:
    print("NA")
n, m = map(int, input().split())
num = 2/n*(n-1) + 2/m*(m-1)
print(num)

### FIXED CODE ###

n, m = map(int, input().split())
num = ((n**2-n)//2) + ((m**2-m)//2)
print(num)
import itertools
while True:
	try: n=int(input())
	except EOEError: break
	ans=0
	for (i,j,k) in itertools.product(range(10),range(10),range(10)):
		ans+=(0<=n-(i+j+k)<=9)
	print(ans)



### FIXED CODE ###

import itertools
while True:
	try: n=int(input())
	except EOFError: break
	ans=0
	for (i,j,k) in itertools.product(range(10),range(10),range(10)):
		ans+=(0<=n-(i+j+k)<=9)
	print(ans)
A, B = map(int, input().split())

if A % 3 == 0 or B % 3 == 0 or A + B % == 0:
    print('Possible')
else:
    print('Impossible')

### FIXED CODE ###

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

if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
    print('Possible')
else:
    print('Impossible')
a,b=map(int,input().split())
  print(a+b%24)

### FIXED CODE ###

a,b=map(int,input().split())
print((a+b)%24)
N = int(input())
A = [int(i) for i in input().split()]

d = deque(A)
c = 0
while(len(d)>0):
    tmp = d.pop()
    if tmp%2==0:
        c+=1
        d.append(tmp//2)
print(c)

### FIXED CODE ###

from collections import deque
N = int(input())
A = [int(i) for i in input().split()]

d = deque(A)
c = 0
while(len(d)>0):
    tmp = d.pop()
    if tmp%2==0:
        c+=1
        d.append(tmp//2)
print(c)
N = int(input())
t0 = 0
x0 = 0
y0 = 0
for i in range(0, N):
    t1, x1, y1 = map(int, input().split())
    indicator = (t1-t0)-abs(x1-x0)-abs(y1-y0)
    if indicator<0 or indicator%2==1:
        print("No")
        break
    elif i==N-1:
        print("Yes")
        break
    t0 = t1
    x0 = x1
    y0 = y1


### FIXED CODE ###

a, b = map(int, input().split())
if a*b%2==0:
    print("Even")
else:
    print("Odd")
from fractions import gcd

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

a, b = map(int, input().split())
c = gcd(a, b)
count = 1
for num in primes(c):
  if c % num == 0:
    count += 1
print(count)

### FIXED CODE ###

from math import ceil
from fractions import gcd

a, b = map(int, input().split())
c = gcd(a, b)
count = 1
for num in range(2, ceil(c**0.5) + 1):
  if c % num == 0:
    count += 1
    while c % num == 0:
      c = c // num
if c > 1:
  count += 1
print(count)
import math
A,B = list(map(int,input().split()))

A_min=12*A+math.floor(0.5*A)
A_max=12*(A+1)+math.ceil(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)

print(A_min,A_max,B_min,B_max)
if A_max < B_min:
    print(-1)
elif B_max < A_min:
    print(-1)
else:
    print(max(A_,B_))

### FIXED CODE ###

import math
A,B = list(map(int,input().split()))
 
A_min=12*A+math.ceil(0.5*A)
A_max=12*(A+1)+math.floor(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)
 
if A_max <= B_min:
    print(-1)
elif B_max <= A_min:
    print(-1)
else:
    print(max(A_min,B_min))
import math
from functools import reduce

n = int(input())
a_list = list(map(int, input().split()))
max = a_list[-1] + 2
memo = [0] * max

for a in a_list:
    memo[a] += 1

for i in range(2, max):
    if sum(memo[i::i]) > 1:
        if reduce(math.gcd, a_list) == 1:
            print("setwise coprime")
            exit()
        else:
            print("not coprime")
            exit()

print("pairwise coprime")


### FIXED CODE ###

import math
from functools import reduce
L = 10**6 + 1
n = int(input())
a_list = list(map(int, input().split()))
memo = [0] * L

for a in a_list:
    memo[a] += 1

for i in range(2, L):
    if sum(memo[i::i]) > 1:
        if reduce(math.gcd, a_list) == 1:
            print("setwise coprime")
            exit()
        else:
            print("not coprime")
            exit()

print("pairwise coprime")
N = int(input())

f = [0]*(N + 1)
f[0] = 1
f[1] = 1
for i in range(2, N + 1):
    f[i] = i * f[i - 2]

count = 0
while f[N] % 10 == 0:
    count += 1
    f[N] = f[N] // 10
    #print(count, f[N])

print(count)

if N % 2 == 1:
    print(0)
if N % 2 == 0:
    N_keta = len(str(N)) - 1

    num_10 = list()
    num_50 = list()
    for i in range(1, N_keta + 1):
        num_10.append(N // (10**i))
    sum_10 = sum(num_10)
    
    for i in range(1, N_keta + 1):
        num_50.append((N // (5 * (10**i))))

    print(num_50)
    for i in range(0, len(num_10) - 1):
        num_50[i] -= num_10[i+1]
    

    print(num_50)
    sum_50 = sum(num_50)
    print(sum_10 + sum_50)

### FIXED CODE ###

N = int(input())
"""
f = [0]*(N + 1)
f[0] = 1
f[1] = 1
for i in range(2, N + 1):
    f[i] = i * f[i - 2]

count = 0
while f[N] % 10 == 0:
    count += 1
    f[N] = f[N] // 10
    #print(count, f[N])

print(count)
"""
if N % 2 == 1:
    print(0)
if N % 2 == 0:
    five_count = 0
    while N >= 5**five_count:
        five_count += 1
    
    num_5 = list()
    for i in range(1, five_count + 1):
        num = N // (5**i)

        num_5.append(num//2)
        
    sum_5 = sum(num_5)
    print(sum_5)
import collections
n = int(input())
one = collections.deque([1])
two = collections.deque([])
three = collections.deque([])
graph = [[] for _ in range(n)]

for i in range(n - 1):
    a, b = map(int, input().split())
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
    if i % 3 == 0: two.append(i + 2)
    elif i % 3 == 1: three.append(i + 2)
    else: one.append(i + 2)

que = collections.deque([0])
num = [0] * n
dist = [-1] * n
parity = [0] * 2
dist[0] = 0
flag = True
while len(que) != 0:
    i = que.popleft()
    parity[dist[i] % 2] += 1
    for j in graph[i]:
        if dist[j] != -1: continue
        dist[j] = dist[i] + 1
        que.append(j)

if parity[0] <= n // 3 or parity[1] <= n // 3:
    rem = 0 if parity[0] < parity[1] else 1
    for i, v in enumerate(dist):
        if v % 2 == rem: num[i] = str(three.popleft())
    else:
        if len(one) != 0: str(one.popleft())
        elif len(two) != 0: str(two.popleft())
        else: str(three.popleft())
else:
    for i, v in enumerate(dist):
        if v % 2 == 0:
            if len(one) != 0: num[i] = str(one.popleft())
            elif len(three) != 0: num[i] = str(three.popleft())
            else:
                flag = False
                break
        else:
            if len(two) != 0: num[i] = str(two.popleft())
            elif len(three) != 0: num[i] = str(three.popleft())
            else:
                flag = False
                break

print(' '.join(num))


### FIXED CODE ###

import collections
n = int(input())
one = collections.deque([1])
two = collections.deque([])
three = collections.deque([])
graph = [[] for _ in range(n)]

for i in range(n - 1):
    a, b = map(int, input().split())
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
    if i % 3 == 0: two.append(i + 2)
    elif i % 3 == 1: three.append(i + 2)
    else: one.append(i + 2)

que = collections.deque([0])
num = [0] * n
dist = [-1] * n
parity = [0] * 2
dist[0] = 0
flag = True
while len(que) != 0:
    i = que.popleft()
    parity[dist[i] % 2] += 1
    for j in graph[i]:
        if dist[j] != -1: continue
        dist[j] = dist[i] + 1
        que.append(j)

if parity[0] <= n // 3 or parity[1] <= n // 3:
    rem = 0 if parity[0] < parity[1] else 1
    for i, v in enumerate(dist):
        if v % 2 == rem:
            num[i] = str(three.popleft())
        else:
            if len(one) != 0: num[i] = str(one.popleft())
            elif len(two) != 0: num[i] = str(two.popleft())
            else: num[i] = str(three.popleft())
else:
    for i, v in enumerate(dist):
        if v % 2 == 0:
            if len(one) != 0: num[i] = str(one.popleft())
            elif len(three) != 0: num[i] = str(three.popleft())
            else:
                flag = False
                break
        else:
            if len(two) != 0: num[i] = str(two.popleft())
            elif len(three) != 0: num[i] = str(three.popleft())
            else:
                flag = False
                break

print(' '.join(num))
S = input()
a = S / 3600
b = S % 3600
c = b / 60
d = c % 60
print a + ":" + c + ":" + d

### FIXED CODE ###

S = input()
if S >= 0 and S <= 86400:
   a = S // 3600
   b = S % 3600
   c = b // 60
   d = b % 60
   print "%d:%d:%d" % (a, c, d)
string = input()
N, K = string.split(' ')
if N % K == 0:
    print(0)
else:
    print(1)


### FIXED CODE ###

string = input()
array = string.split(' ')
N = int(array[0])
K = int(array[1])
if N % K == 0:
    print(0)
else:
    print(1)
N,M = map(int,input().split())
edge_from = [set() for _ in range(N+1)]
edge_to = [set() for _ in range(N+1)]
ans = [-1]*(N+1)
child = set()
parent = -1
for _  in range(N-1+M):
    go,to = map(int,input().split())
    edge_from[go].add(to)
    edge_to[to].add(go)
    child.add(to)
for i in range(1,N+1):
    if i not in child:
        parent = i
from collections import deque
stack = deque()
stack.append(parent)
distance = [-1]*(N+1)
distance[parent] = 0
while stack:
    v = stack.popleft()
    for u in edge_from[v]:
        distance[u] = max(distance[v] + 1,distance[u])
        stack.append(u)
for i in range(1,N+1):
    print(distance[i])

### FIXED CODE ###

from collections import defaultdict, deque
import heapq
v, n = map(int, input().split())
es = [[int(x) for x in input().split()] for _ in range(v+n-1)]

outs = defaultdict(list)
ins = defaultdict(int)
edge_from = [[] for _ in range(v+1)]
edge_to = [[] for _ in range(v+1)]
ans = [-1]*(v+1)
for v1, v2 in es:
    edge_from[v1].append(v2)
    edge_to[v2].append(v1)
    outs[v1].append(v2)
    ins[v2] += 1

q = deque(v1 for v1 in range(v) if ins[v1] == 0)
res = []
while q:
    v1 = q.popleft()
    res.append(v1)
    for v2 in outs[v1]:
        ins[v2] -= 1
        if ins[v2] == 0:
            q.append(v2)
rev = [0]*(v+1)
for i in range(1,v+1):
    rev[res[i]] = i
redge_to = [[] for _ in range(v+1)]
for i in range(1,v+1):
    for j in edge_to[i]:
        ri = rev[i]
        rj = rev[j]
        heapq.heappush(redge_to[ri],-rj)
for ri in range(1,v+1):
    if redge_to[ri]:
        rj = redge_to[ri][0]
        i = res[ri]
        j = res[-rj]
        ans[i] = j
    else:
        i =res[ri]
        ans[i] = 0
for i in ans[1:]:
    print(i)
A = list(map(int, input().split())).sort()
print(sum[:2])

### FIXED CODE ###

A = list(map(int, input().split()))
A.sort()
print(sum(A[:2]))
s = sorted(input())
t = sorted(input())
t.reverse()
if s<t:
	print("Yes")
else:
	print("No")

### FIXED CODE ###

print((sum([int(i) for i in input().split()])+1)//2)
S=input()
S=S[:len(S)-1]
s=list(S)
x,y=map(int,input().split())
fora=0
side=[]
updw=[]
while s[0]=="F":
  fora+=1
  s.pop(0)
  if len(s)==0: break
flag=1#1のとき横向き、-1のときたて向き
step=0
while s:
  if s[0]=="T":
    s.pop(0)
    if flag==-1: updw+=[step]
    else: side+=[step]
    flag=flag*(-1)
    step=0
  else:
    s.pop(0)
    step+=1
    if len(s)==0:
      if flag==-1: updw+=[step]
      else: side+=[step]
ypossi=len(side)
tpossi=len(updw)
X=sum(side)+fora
Y=sum(updw)
xdp=[[0 for i in range(2*X+1)] for j in range(ypossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
xdp[0][fora+X]=1 
for i in range(ypossi):
  for j in range(2*X+1):
    if j-side[i]>=0:
      if xdp[i][j-side[i]]==1:xdp[i+1][j]=1
    if j+side[i]<2*X+1:
      if xdp[i][j+side[i]]==1:xdp[i+1][j]=1
        
ydp=[[0 for i in range(2*Y+1)] for j in range(tpossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
ydp[0][Y]=1 
for i in range(tpossi):
  for j in range(2*Y+1):
    if j-updw[i]>=0:
      if ydp[i][j-updw[i]]==1:ydp[i+1][j]=1
    if j+updw[i]<2*Y+1:
      if ydp[i][j+updw[i]]==1:ydp[i+1][j]=1
if xdp[ypossi][x+X]==1 and ydp[tpossi][y+Y]==1:
  print("Yes")
else: print("No")

### FIXED CODE ###

S=str(input())
s=list(S)
x,y=map(int,input().split())
fora=0
side=[]
updw=[]
while s[0]=="F":
  fora+=1
  s.pop(0)
  if len(s)==0:break
flag=1#1のとき横向き、-1のときたて向き
step=0
while s:
  if s[0]=="T":
    s.pop(0)
    if step:
      if flag==-1: updw+=[step]
      else: side+=[step]
    flag=flag*(-1)
    step=0
  elif s[0]=="F":
    s.pop(0)
    step+=1
    if len(s)==0:
      if flag==-1: updw+=[step]
      else: side+=[step]
  else: break
ypossi=len(side)
tpossi=len(updw)
X=sum(side)+fora+abs(x)
Y=sum(updw)+abs(y)
xdp=[[0 for i in range(2*X+1)] for j in range(ypossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
xdp[0][fora+X]=1 
for i in range(ypossi):
  for j in range(2*X+1):
    if j-side[i]>=0:
      if xdp[i][j-side[i]]==1:xdp[i+1][j]=1
    if j+side[i]<2*X+1:
      if xdp[i][j+side[i]]==1:xdp[i+1][j]=1

ydp=[[0 for i in range(2*Y+1)] for j in range(tpossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
ydp[0][Y]=1 
for i in range(tpossi):
  for j in range(2*Y+1):
    if j-updw[i]>=0:
      if ydp[i][j-updw[i]]==1:ydp[i+1][j]=1
    if j+updw[i]<2*Y+1:
      if ydp[i][j+updw[i]]==1:ydp[i+1][j]=1
if xdp[ypossi][x+X]==1 and ydp[tpossi][y+Y]==1:
  print("Yes")
else: print("No")
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))

lasttime = 10
for a in ls:
    b = a%10
    if b < lasttime and b != 0:
        lasttime = b
        ans =a

ls.remove(ans)
sum =0
for i in ls:
    if i%10 ==0:
        sum +=i
    else:
        p = i//10
        sum += (p+1)*10

print(int(sum + ans))



### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))
ls2 = [i%10 for i in ls]
if ls2 == [0,0,0,0,0]:
    print(sum(ls))
else:
    lasttime = 10
    for a in ls:
        b = a%10
        if b < lasttime and b != 0:
            lasttime = b
            ans =a

    ls.remove(ans)
    sum =0
    for i in ls:
        if i%10 ==0:
            sum +=i
        else:
            p = i//10
            sum += (p+1)*10

    print(int(sum + ans))
n,k=map(int,input().split())
l=soted(list(map(int,input().split())))
def gcd(x,y):
  if y==0:return x
  return gcd(y,x%y)
ans=""
s=0
for i in l:
  s=gcd(i,s)
  if s==1:break
else:
  if k%s!=l[-1]%s:
    ans="IM"
print(ans+"POSSIBLE")


### FIXED CODE ###

n,k=map(int,input().split())
l=sorted(map(int,input().split()))
def gcd(x,y):
  if y==0:return x
  return gcd(y,x%y)
ans=""
s=0
for i in l:
  s=gcd(i,s)
  if s==1:break
else:
  if k%s!=l[-1]%s:
    ans="IM"
if l[-1]<k:ans="IM"
print(ans+"POSSIBLE")