Harryxun/stf_run huggingface dataset:
import math
print(int(input())*2*math.py)

### FIXED CODE ###

import math
print(int(input())*math.pi*2)
# D
N,A,B = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)

max_mean = sum(v[:A])/A
print(max_mean)

from collections import Counter
from math import factorial

def comb(n,r):
    return factorial(n)//(factorial(r)*factorial(n-r))

v_count = Counter(v)
ans = 0
if v[0]==v[A-1]:
    n = v_count[v[A-1]]
    for r in range(A, B+1):
        if r>n: break
        ans += comb(n, r)
else:
    print(n, r)
    n = v_count[v[A-1]]
    select_count = Counter(v[:A])
    r = select_count[v[A-1]]
    ans = comb(n,r)
print(ans)

### FIXED CODE ###

# D
N,A,B = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)

max_mean = sum(v[:A])/A
print(max_mean)

from collections import Counter
from math import factorial

def comb(n,r):
    return factorial(n)//(factorial(r)*factorial(n-r))

v_count = Counter(v)
ans = 0
if v[0]==v[A-1]:
    n = v_count[v[A-1]]
    for r in range(A, B+1):
        if r>n: break
        ans += comb(n, r)
else:
    #print(n, r)
    n = v_count[v[A-1]]
    select_count = Counter(v[:A])
    r = select_count[v[A-1]]
    ans = comb(n,r)
print(ans)
N = int(input())
S = input()
K = int(input())
t = S[K+1]
ans = ""
for s in S:
  if s == t:
    ans += s
  else:
    ans += "*"
print(ans)

### FIXED CODE ###

N = int(input())
S = input()
K = int(input())
t = S[K-1]
ans = ""
for s in S:
  if s == t:
    ans += s
  else:
    ans += "*"
print(ans)
n = int(input())
V = list(map(int, input().split()))
A = [] # 偶数
B = [] # 奇数

inf = 999999999999999999999

import collections

for i in range(n):
  if i % 2 == 0:
    A.append(V[i])
  else:
    B.append(V[i])

A = collections.Counter(A).most_common()
B = collections.Counter(B).most_common()

count = 0

if A[0][0] == B[0][0]:
  count += min(A[0][1], B[0][1])
  if A[0][1] == B[0][1]:
    if A[1][1] > B[1][1]:
      A.pop(0)
    else:
      B.pop(0)
    

A.pop(0)
B.pop(0)

for key, value in A:
  count += value

for  key, value in B:
  count += value

print(count)

### FIXED CODE ###


n = int(input())
V = list(map(int, input().split()))
A = [] # 偶数
B = [] # 奇数

import collections

for i in range(n):
  if i % 2 == 0:
    A.append(V[i])
  else:
    B.append(V[i])

A = collections.Counter(A).most_common()[:2]
B = collections.Counter(B).most_common()[:2]
count = 0

if A[0][0] == B[0][0]:
  count += max(A[0][1], B[0][1])
  if A[0][1] == B[0][1]:
    if len(A) > 1 and len(B) > 1:
      count += max(A[1][1], B[1][1])
    elif len(A) > 1:
      count += max(A[1][1])
    elif len(B) > 1:
      count += max(B[1][1])
else:
  count += A[0][1] + B[0][1]

print(n-count)
N = int(input())
f = lambda n: n*f(n-1) if n > 1 else 1
K = f(N)
ans = 1
for i in range (2, N + 1):
    num = 0
    while K % i == 0:
        num += 1
        K //= i
    ans *= (num + 1)

print(ans % (10**9 + 7))

### FIXED CODE ###

N = int(input())
K = eval("*".join(map(str, list(range(1, N+1)))))
ans = 1
for i in range (2, N + 1):
    num = 0
    while K % i == 0:
        num += 1
        K //= i
    ans *= (num + 1)
print(ans % (10**9 + 7))
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int f(vector<int> v, int i, int a) {
    vector<int>::iterator maxIt = max_element(v.begin(), v.end());
    vector<int>::iterator minIt = min_element(v.begin(), v.end());
    if (v.size() == 0){
        return a;
    }
    if(*maxIt == *minIt) {
        return a + (*minIt) - i;
    }
    a+=*minIt-i;
    i = *minIt;
    size_t minIndex = distance(v.begin(), minIt);
    if (minIndex == 0) {
        vector<int> vec;
        copy(next(v.begin()), v.end(), back_inserter(vec));
        a = f(vec, i, a);
    } else if (minIndex == v.size()) {
        vector<int> vec;
        copy(v.begin(), prev(v.end()), back_inserter(vec));
        a = f(vec, i, a);
    } else {
        vector<int> vec1;
        copy(v.begin(), minIt, back_inserter(vec1));
        a = f(vec1, i, a);
        vector<int> vec2;
        copy(next(minIt), v.end(), back_inserter(vec2));
        a = f(vec2, i, a);
    }
    return a;
}


int main() {
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i=0; i<n; i++) {
        cin >> v[i];
    }
    int a = f(v, 0, 0);

    return 0;
}

### FIXED CODE ###

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

maxNum = max(h)
countNumber = 0
countWatering = 0
isfinished = False
for c in range(1, maxNum+1):
    array = []
    for index, num in enumerate(h):
        if (num >= c):
            array.append(index)
    if (len(array) == 0 or c > maxNum):
        break
    startIndex = 0
    beforeVlaue  = array[0]-1
    for a in array:
        if (a-1 != beforeVlaue):
            countWatering+=1
        if (a == array[-1]):
            countWatering+=1
        beforeVlaue = a
    
print(countWatering)
from collections import Counter
n = int(input())
s = [input() for i in range(n)]

a = Counter(s)
b = a.most_common()[0][1]

s = list(set(s)) #sの重複した要素を消す

print(a[])

for i in s:
    if a[i] == b:
        print(i)

### FIXED CODE ###

from collections import Counter
n = int(input())
s = [input() for i in range(n)]

a = Counter(s)

b = a.most_common()[0][1]

s = list(set(s)) #sの重複した要素を消す
s.sort()

for i in s:
    if a[i] == b:
        print(i)
n,x = map(int,input().split())
li = list(map(int,input().split()))
lin = [abs(i-x) for i in li]
print(lin)
import fractions#python3.4ではmathではなくこちらのライブラリを用いる
def gcd_all(list):
    return gcd_all([fractions.gcd(*list[:2])] + list[2:]) if len(list) > 1 else list[0]
gcd = gcd_all(lin)

print(gcd)

### FIXED CODE ###

from sys import stdin
import fractions


n,x = [int(x) for x in stdin.readline().rstrip().split()]

li = list(map(int,stdin.readline().rstrip().split()))
lin = []
for i in range(len(li)):
    lin.append(abs(li[i]-x))
poi = lin[0]
for i in range(len(lin)-1):
    poi = fractions.gcd(poi,lin[i+1])

print(poi)
A, B, K = map(int, input().split())

ans = [1]
for i in range(2, A):
    if A % i == 0 and B % i == 0:
        ans.append(i)

print(ans[-K])

### FIXED CODE ###

import sys
A, B, K = map(int, input().split())
cnt = 0
if min(A, B) == 1:
    print(1)
    sys.exit()
    
for i in range(min(A, B), 0, -1):
    if A % i == 0 and B % i == 0:
        cnt += 1
        if cnt == K:
            print(i)
            break
n, m = map(int, input().split())
edges = [[] for i in range(n)]
visit = [False for i in range(n)]
def dfs(v):
    visit[v] = True
    for i in edges[v]:
        if not visit[i]:
            dfs(i)
for i in range(m):
    a, b = map(int, input().split())
    edges[a - 1].append(b - 1)
    edges[b - 1].append(a - 1)
cnt = 0
for i in range(n):
    if not visit[i]:
        dfs(i)
        cnt += 1
print(cnt - 1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(2 * (10 ** 6))
n, m = map(int, input().split())
edges = [[] for i in range(n)]
visit = [False for i in range(n)]
def dfs(v):
    visit[v] = True
    for i in edges[v]:
        if not visit[i]:
            dfs(i)
for i in range(m):
    a, b = map(int, input().split())
    edges[a - 1].append(b - 1)
    edges[b - 1].append(a - 1)
cnt = 0
for i in range(n):
    if not visit[i]:
        dfs(i)
        cnt += 1
print(cnt - 1)
A = input()
A =int(A)
P = input()
P =int(P)

X = (A * 3 + P) // 2 
print(X)

### FIXED CODE ###

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



a=((P + A * 3) / 2)
print(int(a))
N = int(input())
D = list(map(int, input().split()))

if D[0] != 0:
    print(0)
else:
    D.sort()

    if D[1] == 0:
        print(0)
        break

    mod = 998244353
    ans = 1
    distance = 0
    prev = 1
    now = 0
    
    for i in range(N):
        if D[i] == distance:
            now += 1
        elif D[i] == distance + 1:
            ans = (ans % mod) * (prev ** now % mod) % mod
            prev = now+0
            now = 1
            distance += 1
        else:
            ans = 0
            break
    else:
        ans = (ans % mod) * (prev ** now % mod) % mod
    
    print(ans)

### FIXED CODE ###

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

if D[0] != 0:
    print(0)
else:
    D.sort()

    if D[1] == 0:
        print(0)
    else:
        mod = 998244353
        ans = 1
        distance = 0
        prev = 1
        now = 0

        for i in range(N):
            if D[i] == distance:
                now += 1
            elif D[i] == distance + 1:
                ans = (ans % mod) * (prev ** now % mod) % mod
                prev = now+0
                now = 1
                distance += 1
            else:
                ans = 0
                break
        else:
            ans = (ans % mod) * (prev ** now % mod) % mod
        
        print(ans)
N,Y = map(int, input().split())
for i in range(N+1):
  for j in range(N+1-i):
    k = N-i-j
      if Y == 10000*i + 5000*j + 1000*k:
        print(i j k)
        sys.exit()
print(-1 -1 -1)

### FIXED CODE ###

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

def f():
  for i in range(N+1):
    for j in range(N+1-i):
      k = N-i-j
      if Y == 10000*i + 5000*j + 1000*k:
        return i,j,k
  return -1,-1,-1

a,b,c = f()
print(a,b,c)
K=int(input())
S=list(input())

SL=len(S)

if SL =< K:
    print(S)
elif SL > K:
    print(S[0:(SL-1):1])

### FIXED CODE ###

K=int(input())
S=input()
s=list(S)

if len(s) <= K:
    print(S)
else:
    print(S[0:K:]+"...")
# -*- coding: utf-8 -*-
A, B, M = map(int,  input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sum = [0.0] * (A * B)

for i in range(M):
        x, y, c = map(int,  input().split())
        sum[(y-1)*A + (x-1)] -= c

for ia in range(A):
        for ib in range(B):
                sum[ib*A + ia] += a[ia] + b[ib]

sum.sort()

i=0
while sum[i] < 0:
        i+=0
print(int(sum[i]))


### FIXED CODE ###

# -*- coding: utf-8 -*-
A, B, M = map(int,  input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

sum = []
for i in range(M):
        x, y, c = map(int,  input().split())
        sum.append(a[x-1]  + b[y-1] - c)

a.sort()
b.sort()

sum.append(a[0] + b [0])

sum.sort()

i=0
while sum[i] < 0:
        i+=0
print(sum[i])
N = input()
R = N%1000

if R == 0:
    print(0)

else :
    print(abs(R-1000))

### FIXED CODE ###

N = int(input())
R = N % 1000
if R == 0:
    print(0)
else:
    print(abs(R-1000))
n,d=map(int,input().split())
ctr=0
for i in range(n):
  x,y=map(int,input().split())
  t=(x**2+y**2)**(1/2)
  if t>=d:
    ctr+=1
print(ctr

### FIXED CODE ###

n,d=map(int,input().split())
ctr=0
for i in range(n):
  x,y=map(int,input().split())
  t=(x**2+y**2)**(1/2)
  if t<=d:
    ctr+=1
print(ctr)
n = int(input())

for i in range(1, n+1):
    if 100*i <= n <= 105*i:
        print(1)
        exit()

print(0)

### FIXED CODE ###

m1, d2 = map(int, input().split())
m2, d2 = map(int, input().split())

if m2 - m1 == 1:
    print(1)

if m2 - m1 == 0:
    print(0)
A , B = map(int , input().split())

plug = 1
tap = 0

for i in range():
    if plug >= B:
        break
    else:
        prug += A - 1 and tap += 1

print(tap)

### FIXED CODE ###

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

plug = 1
tap = 0

for i in range(20):
    if plug >= B:
        break
    else:
        plug += A - 1
        tap += 1

print(tap)
x,n= map(int,input().split())
u = 100
num_str=input().split()
s=list(map(int, num_str))
m  = list(range(-100, 100)) 
for k in s:
    m.remove(k)
for l in m:
    a = l - x
    if abs(u) > abs(a):
        u = a
print(u+x)

### FIXED CODE ###

x,n= map(int,input().split())
u = 100
num_str=input().split()
s=list(map(int, num_str))
m  = list(range(-100,200)) 
for k in s:
    m.remove(k)
for l in m:
    a = l - x
    if abs(u) > abs(a):
        u = a
print(u+x)
n=int(input())
s=len(n)
N=''
for i in range(s[:s+1:-1]):
    a = n % (10**i)
    N.append(a)
al = sum(N)
if al%n == 0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n=input()
f=0
for i in range(len(n)):
    f += int(n[i])
if int(n) % f == 0:
    print('Yes')
else:
    print('No')
import math

n = int(input())

for i in range(0, n):
    a = int(input())
    b = int(input())
    if math.log10(a + b) + 1 > 80:
        print("overflow")
    else :
        print(a + b)

### FIXED CODE ###

n = int(input())

for i in range(0, n):
    a = int(input())
    b = int(input())
    if len(str(a + b)) > 80:
        print("overflow")
    elif len(str(a)) > 80:
        print("overflow")
    elif len(str(b)) > 80:
        print("overflow")
    else :
        print(a + b)
a=input()
b=input()
a==b?print('Yes'):print('No')

### FIXED CODE ###

a=input().split()
if int(a[0]) == int(a[1]):
  print('Yes')
else:
  print('No')
a, b, c = input().split()
print(f'{c},{a},{b}')

### FIXED CODE ###

a, b, c = input().split()
print(c, a, b)
A,B = map(int,input().split())
 
K=(A+B)/2
 
def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False
 
if is_integer_num(K)==False:
  print(IMPOSSIBLE)
else:
  print(K)

### FIXED CODE ###

A,B = map(int,input().split())
 
K=(A+B)/2
 
def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False
 
if is_integer_num(K)==False:
  print("IMPOSSIBLE")
else:
  print(int(K))
W, H, x, y = map(int, input().split())

ans = [min(x, W - x) * H, min(y, H - y) * W]

if (x == 0 and y == 0) or (x == 1 and y == 0) or (x == 0 and y == 1) or (x == 1 and y == 1):
    print(W * H / 2, 0)
elif W == 
else:
    print(max(ans), int(ans[0] == ans[1]))


### FIXED CODE ###

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

print(W * H / 2, 1 if W / 2 == x and H / 2 == y else 0)
import sympy
import math
N = int(input())
l = math.factorial(N)
t = sympy.divisors(l)
print(len(t)%(10**9+7))

### FIXED CODE ###

N= int(input())

m = 10**9+7
pri_num = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
dic = {}

for i in range(2,N+1):
    for pri in pri_num:
        while i>0:
            if i % pri == 0:
                if pri in dic:
                    dic[pri] +=1
                else:
                    dic[pri]=1
                i = i//pri

            else:
                break

count = 1
for val in dic.values():
    count = (count*(val+1))%m
print(count)
l,r = map(int, input().split())

if r//673 > (l-1)//673 and r-l = 2:
  print('0')

else:
    print((l%2019) * ((l+1)%2019))

### FIXED CODE ###

from itertools import combinations

l,r = map(int, input().split())

if r//673 > (l-1)//673 and r//3 >(l-1)//3:
  print('0')

else:
    cmb = list(combinations(range(l, r+1), 2))
    mod = [(cmb[i][0] * cmb[i][1]) % 2019 for i in range(len(cmb))]
    print(min(mod))
a = int(input())
c = ''
while (a >= 26):
    b = a % 26
    c += chr(ord('a') + b - 1)
    a /= 26
c += chr(ord('a') + int(a) - 1)
print(c[::-1])


### FIXED CODE ###

a = int(input())
c = ''
while (a > 26):
    b = int(a) % 26
    c += chr(ord('a') + (25 if b == 0 else int(b) - 1))
    a = int(a / 26 - 1 if a % 26 == 0 else a / 26)
c += chr(ord('a') + int(a) - 1)
print(c[::-1])
s = int(input())
if s =='ABC':
    print('ARC')
else:
    print('ABC')

### FIXED CODE ###

s = input()
if s =='ABC':
    print('ARC')
else:
    print('ABC')
A = int(input())
B = int(input())
C = int(input())
X = int(input())

res += 0

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a*500 + 100*b + c*50 == X:
        res += 1
        
print(res)

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
 
res = 0
 
for i in range(A + 1):
  for j in range(B + 1):
    for k in range(C + 1):
      if 500*i + 100*j + 50*k == X:
        res += 1
 
print(res)
s = raw_input()
print s[:4] + " " + s[4:]

### FIXED CODE ###

s = raw_input()
s2 = s[:4] + " " + s[4:]
print(s2)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""042-c"""

import sys

ZERO_UNICODE = 48


def solve(dislike_digits_table, first_like_digit, number):
    """Solve."""
    if dislike_digits_table[int(number[0])]:
        while dislike_digits_table[int(number[0])]:
            number = "{0}{1}".format(chr(ord(number[0]) + 1), number[1:])
        number = number.replace(number[1:], first_like_digit * (len(number) - 1))

    return number


def main():
    """Main function."""
    dislike_digits_table = [False for _ in range(10)]

    N, _ = sys.stdin.readline().split(' ')
    digits = map(int, sys.stdin.readline().split(' '))

    for digit in digits:
        dislike_digits_table[digit] = True

    first_like_digit = str(next(i for i, v
                            in enumerate(dislike_digits_table)
                            if not v))

    for i, d in enumerate(N):
        if dislike_digits_table[int(d)]:
            N = N.replace(N[i:], solve(dislike_digits_table, first_like_digit, N[i:]))
            break

    print(N)


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

### FIXED CODE ###

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

"""042-c"""

import sys


def solve(dislike_digits_table, first_like_digit, N):
    """Solve."""
    for i, _ in enumerate(N):
        c = N[i]
        while dislike_digits_table[int(c)]:
            if c == '9':
                if i == 0:
                    return solve(dislike_digits_table,
                                 first_like_digit,
                                 '1' + '0' * len(N))
                else:
                    return solve(dislike_digits_table,
                                 first_like_digit,
                                 str(int(N[0:i+1]) + 1)
                                    + '0' * len(N[i+1:]))
            else:
                c = chr(ord(c) + 1)
            N = N[0:i] + c + '0' * len(N[i+1:])

    return N


def main():
    """Main function."""
    dislike_digits_table = [False for _ in range(10)]

    N, _ = sys.stdin.readline().split(' ')
    digits = map(int, sys.stdin.readline().split(' '))

    for digit in digits:
        dislike_digits_table[digit] = True

    first_like_digit = str(next(i for i, v
                                in enumerate(dislike_digits_table)
                                if not v))

    print(solve(dislike_digits_table, first_like_digit, N))


if __name__ == '__main__':
    sys.exit(main())
N = int(input())
S = input()
countW = S.count('W')
if countW==0:
	print(0)
	exit()
if countW==N:
	print(0)
	exit()
leftW = S[:countW].count('W')
rightR = S[countW:].count('R')
print(max(leftW, rightR))

### FIXED CODE ###

X=int(input())
if X>=30:
  print('Yes')
else:
  print('No')
n = list(map(str, input()))
if n[0] = n[2]:
	print("Yes")
else:
	print("No")


### FIXED CODE ###

n = list(map(str, input()))
if n[0] == n[2]:
	print("Yes")
else:
	print("No")
def gcd(x,y):
    while y:
        x, y = y, x % y
    return x


a, b = [int(x) for x in input().split(' ')]

g = gcd(a,b)
print("g =", g)
ret: int = 1
i = 2
while i * i <= g:
    if g % i == 0:
        print("i =", i)
        while g % i == 0:
            g /= i
        ret += 1
    i += 1     
        
if g > 1:
    ret += 1
    
print(ret)

### FIXED CODE ###

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x


a, b = [int(x) for x in input().split(' ')]

g = gcd(a, b)
ret = 1
i = 2
while i * i <= g:
    if g % i == 0:
        while g % i == 0:
            g /= i
        ret += 1
    i += 1

if g > 1:
    ret += 1

print(ret)
n=int(input())
A=list(map(int,input().split()))
from collections import deque
q=deque(A)
 
ans=1
while len(q)>0:
    p=q.popleft()
    ans=ans*p
if ans>1000000000000000000:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

from decimal import Decimal
a,b=list(map(Decimal,input().split()))
print(int(a*b))
A=int(input())
B=int(input())
if A>2*B:
  print(A-2B)
else:
  print(0)

### FIXED CODE ###

a,b=map(int,input().split())
if a-2*b>0:
  print(a-2*b)
else:
  print("0")
n, a, b, c, d = map(lambda x:int(x)-1,input().split())
n += 1
S = input()

ok = True
overtake = False

if c < d:
    overtake = True
    
for i in range(a,d):
    if S[i] == "#" and S[i+1] == "#":
        ok = False

for i in range(b,d+1):
    if S[i] == "." and S[i-1] == "." and S[i+1] == ".":
        overtake = True
        
if ok and overtake:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n, a, b, c, d = map(lambda x:int(x)-1,input().split())
n += 1
S = input()

ok = True
overtake = False

if c < d:
    overtake = True
    
for i in range(a,d):
    if S[i] == "#" and S[i+1] == "#":
        ok = False

for i in range(b,min(d+1,n-1)):
    if S[i] == "." and S[i-1] == "." and S[i+1] == ".":
        overtake = True
        
if ok and overtake:
    print('Yes')
else:
    print('No')
n, m = map(int, input().split())
a = list(map(int, input().split()))
l = [0 for i in range(n+1)]

for i in range(1, m+1):
    for j in range(n):
        if a[j]<=i and l[i-a[j]] == 0:
            l[i] = 1
            
if l[k] ==1:
    print("First")
else:
    print("Second")

### FIXED CODE ###

import sys
input = sys.stdin.readline
 
N, K = map(int, input().split())
A = [int(i) for i in input().split()]
 
dp = [0 for i in range(K+1)]
for i in range(K+1):
    if not dp[i]:
        for j in range(N):
            if i + A[j] < K + 1:
                dp[i+A[j]] = 1
 
if dp[K]: print("First")
else: print("Second")
import sys
from pprint import pprint

S = sys.stdin.readline().strip()
Q = int(sys.stdin.readline().strip())

n_rev = 0
for _ in range(Q):
    tmp = sys.stdin.readline().strip().split()
    if tmp[0] == "1":
        n_rev += 1
    else:
        f, c = tmp[1], tmp[2]
        if f == "1":
            if n_rev % 2 == 0:
                S = c + S
            else:
                S = S + s
        else:
            if n_rev % 2 == 0:
                S = S + c
            else:
                S = c + S

if n_rev % 2 == 0:
    print(S)
else:
    print(S[::-1])

### FIXED CODE ###

import sys
from pprint import pprint
from collections import deque

S = list(sys.stdin.readline().strip())
Q = int(sys.stdin.readline().strip())

q = deque(S)

n_rev = 0
for _ in range(Q):
    tmp = sys.stdin.readline().strip().split()
    if tmp[0] == "1":
        n_rev += 1
    else:
        f, c = tmp[1], tmp[2]
        if f == "1":
            if n_rev % 2 == 0:
                #S = c + S
                q.appendleft(c)
            else:
                #S = S + c
                q.append(c)
        else:
            if n_rev % 2 == 0:
                #S = S + c
                q.append(c)
            else:
                #S = c + S
                q.appendleft(c)

S = "".join(list(q))
if n_rev % 2 == 0:
    print(S)
else:
    print(S[::-1])