Harryxun/stf_run huggingface dataset:
N = int(input())

def func(n):
    if n<2:
        return 1
    else:
        return n*func(n-2)

f = list(str(func(N)))  
ans = 0

for i in range(1,len(f)):
    if f[-i]== "0":
        ans += 1
    else:
        break
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0
if N%2 == 1:
    print(0)
else:
    for i in range(1,len(str(N))+100):
        ans += N//(2*5**i)
    print(ans)
list = int(input().split())
a = list[0]
b = list[1]

print (a*b + " " + 2*(a+b))


### FIXED CODE ###

a, b = map(int, input().split())
print (a*b, 2*(a+b))
r = raw_input()
   r = int(r)
   a = r*r*3.141592
   b = 2 * r 3.141592
   print "a b"

### FIXED CODE ###

import math
r = raw_input()
r = float(r)
a = r*r*math.pi
b = 2 * r *math.pi
print "%.9f %.9f"%(a,b)
import sys
import numpy as np

N = int(input())

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

if np.sum(A==0) != 0:
# Aに0が含まれる場合
    # 最後に0が出てくる場所
    z = np.max(np.where(A==0))
    B = A[z:N]

    # B = [0 -?]のときだけ例外
    if B.shape[0] == 2 and B[-1] < 0:
        sign = 1
        break

    elif np.sum(B < 0)%2 ==0:
        sign = 1
    else:
        sign = -1

# Aに0が含まれない場合
else:
    if np.sum(A < 0)%2 ==0:
        sign = 1
    else:
        sign = -1

print(np.abs(A[0:N-1]).sum() + sign*abs(A[-1]))

### FIXED CODE ###

import sys

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


ans = 0
for a in A:
    ans += abs(a)

c = 0
m = abs(A[0])
for a in A:
    if a < 0:
        c += 1
    elif a == 0:
        print(ans)
        sys.exit()

    if abs(a) < m:
        m = abs(a)

if c % 2 == 0:
    print(ans)
else:
    print(ans - 2 * m)
n=int(input())
s,t=map(input().split())
k=[]
for i in range(n):
    k.append(s[i])
    k.append(t[i])
print("".join(k))


### FIXED CODE ###

n=int(input())
s,t=input().split()
k=[]
for i in range(n):
    k.append(s[i])
    k.append(t[i])
print("".join(k))
n=int(input())
d=[int(input()) for _ in range(n)]
c = collections.Counter(d)
print(len(c))

### FIXED CODE ###

n=int(input())
d=[int(input()) for _ in range(n)]
print(len(set(d)))
l = list(map(int, input().split()))

while(l != None):
    print(int(len(str(l[0]+l[1]))))
    l = list(map(int, input().split()))


### FIXED CODE ###

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

while(l != []):
    try:
        length = len(str(l[0]+l[1]))
        print(length)
        l = list(map(int, input().split()))
    except:
        break
import math
import collections
import fractions
import itertools
import functools
import operator

def ncr(n, r):
    if n < r: return 0
    r = min(r, n-r)
    numer = functools.reduce(operator.mul, range(n, n-r, -1), 1)
    denom = functools.reduce(operator.mul, range(1, r+1), 1)
    return numer / denom

def solve():
    n, k = map(int, input().split())
    for i in range(1,k+1):
        ans = (ncr(k-1, i-1) * ncr(n-k+1, i)) % (10**9+7)
        print(int(ans))
    return 0

if __name__ == "__main__":
    solve()


### FIXED CODE ###

import math
import collections
import fractions
import itertools
import functools
import operator

def ncr(n, r):
    if n < r: return 0
    r = min(r, n-r)
    if r == 0:
        return 1
    numer = functools.reduce(operator.mul, range(n, n-r, -1), 1)
    denom = functools.reduce(operator.mul, range(1, r+1), 1)
    return numer // denom % (10 ** 9 + 7)

def solve():
    n, k = map(int, input().split())
    for i in range(1,k+1):
        ans = (ncr(k-1, i-1) * ncr(n-k+1, i)) % (10**9+7)
        print(int(ans))
    return 0

if __name__ == "__main__":
    solve()
N = int(input())
A = list(int, input().split())
for i in A:
    if not(i % 3 == 0 or i % 5 == 0):
        print("DENIED")
        break
else:
    print("APPROVED")

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
for i in A:
    if i % 2 == 0:
        if not(i % 3 == 0 or i % 5 == 0):
            print("DENIED")
            break
else:
    print("APPROVED")
mod = 10 ** 9 + 7
def dfs(v, p, k):
    ret = 1
    if len (graph[v]) > k:
        return 0
    kc = k - 2
    if p == -1:
        kc = k - 1
    for vi in graph[v]:
        if vi != p:
            ret *= kc
            ret = ret % mod
            ret *= dfs(vi, v, k)
            ret = ret % mod
            kc -= 1
    return ret

n, k = map(int, input().split())
graph = [[] for _ in range(n)]
for _ in range(n - 1):
    a, b = map(int, input().split())
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
    
print((dfs(0, -1, k) * k) % mod)

### FIXED CODE ###

import sys
sys.setrecursionlimit(410000)

mod = 10 ** 9 + 7
def dfs(v, p, k):
    ret = 1
    if len(graph[v]) > k:
        return 0
    kc = k - 2
    if p == -1:
        kc = k - 1
    for vi in graph[v]:
        if vi != p:
            ret *= kc
            ret = ret % mod
            kc -= 1
    for vi in graph[v]:
        if vi != p:
            ret *= dfs(vi, v, k)
            ret = ret % mod
    return ret

n, k = map(int, input().split())
graph = [[] for _ in range(n)]
for _ in range(n - 1):
    a, b = map(int, input().split())
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
    
print((dfs(0, -1, k) * k) % mod)
N = int(input())
if N == 1 or N == 2:
    print(N)
else:
    for i in range(N):
        if i*(i+1)//2 > N:
            num = i-1
            break
    ans = []
    for i in range(num):
        ans.append(i+1)
    if num*(num+1)//2 != N:
        cnt = N-num*(num+1)//2
        ans.remove(num+1-cnt)
        ans.append(num+1)
    for x in ans:
        print(x)

### FIXED CODE ###

N = int(input())
if N == 1 or N == 2:
    print(N)
else:
    for i in range(N+1):
        if i*(i+1)//2 > N:
            num = i-1
            break
    ans = []
    for i in range(num):
        ans.append(i+1)
    if num*(num+1)//2 != N:
        cnt = N-num*(num+1)//2
        ans.remove(num+1-cnt)
        ans.append(num+1)
    for x in ans:
        print(x)
N = int(input())    
color_list =  [int(input())]
for i in range(N-1):
    new_value = int(input())
    if(new_value > color_list[0]):
        color_list[0] = new_value
    elif(new_value <= color_list[-1]):
        color_list.append(new_value)
    else:
        for i in range(len(color_list)):
          break
print(len(color_list))

### FIXED CODE ###

a = int(input())
print(3*a*a)
S = list(input())
S.append("A")
for i in range(26):
    if S.count(chr(97 + i)) >= 2:
        for j in range(len(S) - 1):
            if (S[j] == chr(97 + i)) and (S[j + 1] == chr(97 + i)):
                print((j+1), (j+2))
                exit()
            if (S[j] == chr(97 + i)) and (S[j + 2] == chr(97 + i)):
                print((j+1), (j+3))
                exit()
else:
    print("-1 -1")


### FIXED CODE ###

S = list(input())
S.append("A")
for j in range(len(S) - 2):
    if (S[j] == S[j + 1]):
        print(j+1, j+2)
        exit()
    if (S[j] == S[j + 2]):
        print(j+1, j+3)
        exit()
else:
    print("-1 -1")
def Fib(n, memo={}):
    if n == 1:
        return 0
    elif n == 2:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n] = Fib(n-1, memo) + Fib(n-2, memo)
        return memo[n]
    
N, M = map(int, input().split())
A = [int(input()) for i in range(M)]

x=0
L=[]
for i in range(M):
    L += [A[i] - 1 - x]
    x = A[i] + 1
L += [N - x]
L = [Fib(i+2) for  i in L]

X=1
for i in range(len(L)):
    X=X*L[i]%1000000007
print(X)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

from itertools import product

def mat2_mul(X, Y):
    Z = [ [0, 0], 
          [0, 0] ]
    for (i,j,k) in product(range(2),range(2),range(2)):
        Z[i][j] += X[i][k] * Y[k][j]
    return Z

def mat2_pow(X, n):
    if n == 0:
        return [ [1, 0],
                 [0, 1] ]
    elif n % 2:
        return mat2_mul(X, mat2_pow(X, n-1))  
    else:
        half_pow = mat2_pow(X, n/2)
        return mat2_mul(half_pow, half_pow)

def Fib(n):
    if n == 0:
        return 0
    else:
        F = [ [0, 1],
              [1, 1] ]
        return mat2_pow(F, n-1)[1][1]
    
    
N, M = map(int, input().split())
A = [int(input()) for i in range(M)]

x=0
L=[]
for i in range(M):
    L += [A[i] - 1 - x]
    x = A[i] + 1
L += [N - x]
L = [Fib(i+1)%1000000007 for  i in L]

X=1
for i in range(len(L)):
    X *= L[i]
    X %= 1000000007 
print(X)
import math

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

ans = 0
i = 2
while c != 1:
    while c % i == 0:
        c = c // i
    #print(c,i,ans)
    i = i + 1
    ans += 1
    
print(ans + 1)

### FIXED CODE ###

from fractions import gcd

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

ans = 0
i = 2
check = False
while c != 1:
    #print(c,i)
    while c % i == 0:
        #print('a')
        c = c // i
        check = True
    i = i + 1
    if check:
        ans += 1
    check = False
    if i > 1000000:
        print(ans+2)
        exit()
print(ans + 1)
n=int(input())
s=list(input())
a=[chr(i) for i in range(65,65+26)]

for i in range(n):
  for j in range(26):
    if s[i]==a[j]:
      s[i]=a[(j+n)%26]
print(''.join(s))

### FIXED CODE ###

n=int(input())
s=list(input())
a=[chr(i) for i in range(65,65+26)]

for i in range(len(s)):
  for j in range(len(a)):
    if s[i]==a[j]:
      if j+n<26:
        s[i]=a[j+n]
      else:
        s[i]=a[j+n-26]
      break

print(''.join(s))
# coding: utf-8

# 標準入力 <int>
N = int(input())

# 標準入力<str>
S = input()

ans = 0

for i in range(N - 2):
  S2 = []
  for j in range(N - i - 2):
    if S[i] == S[i + j + 1]:
      continue
    if i + ((j + 1) * 2) < N:
      S2 = S[i + j + 2:i + (2 * j) + 2] + S[i + (2 * j) + 3:]
    else:
      S2 = S[i + j + 2:]
    print("S2 :",S2)
    S2 = S2.replace(S[i], "")
    S2 = S2.replace(S[i + j + 1], "")
    ans += len(S2)

print(ans)


### FIXED CODE ###

# coding: utf-8

# 標準入力 <int>
N = int(input())

# 標準入力<str>
S = input()

R = S.count("R")
G = S.count("G")
B = S.count("B")

cnt = 0

for i in range(N - 2):
  for j in range(i + 1, N - 1):
    k = i + ((j - i) * 2)
    if k < N:
      if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
        cnt += 1

print(R * G * B - cnt)
s=[]
x,n=map(int,input().split())
if n==0:
  print(x)
  exit()
s=list(map(int,input().split()))
slist=sorted(s)

  
for i in range(0,1000):
  for j in range(n):
    if slist[j]==x-i:
        flag=1
    if slist[j]==x+i:
        flag=2
            
  if flag==2:
    flag=0
  elif flag==1:
    print(x+i)
    exit()
  elif flag==0:
    print(x-i)
    exit()


### FIXED CODE ###

s=[]
x,n=map(int,input().split())
if n==0:
  print(x)
  exit()
  
s=list(map(int,input().split()))
slist=sorted(s)
out=0
for i in range(0,1000):
  out=0
  for j in range(n):
    if slist[j]==x-i:
      out=1
  if out !=1:
   print(x-i)
   exit()
  out=0
  for k in range(n):
    if slist[k]==x+i:
      out=1
  if out !=1:
    print(x+i)
    exit()
import sys
import bisect  # 二分法

MAX_N = 200005
INF = 10**9 + 5

N = int(sys.stdin.readline())
A = [int(x) for x in sys.stdin.readline().split()]
E = [[] for _ in range(N)]  # 辺の情報

for _ in range(N-1):
    u, v = map(int, sys.stdin.readline().split())
    E[u-1].append(v-1)
    E[v-1].append(u-1)

lis = [INF] * N
ans = [0] * N 

def dfs(u,r=-1):

    # u を訪れたときの処理
    i = bisect.bisect_left(lis, A[u])  # 
    old = lis[i]  # 書き換え前の値を一時保存
    lis[i] = A[u]

    for v in E[u]:
        if v == r: continue  # 親は無視

        dfs(v,u)
    
    ans[u] = bisect.bisect_left(lis,INF-1)
    lis[i] = old  # 書き換え前の状態に戻す

dfs(0)
for i in range(N):
    print(ans[i])

### FIXED CODE ###

import sys
import bisect  # 二分法


MAX_N = 200005
INF = 10**9 + 5

sys.setrecursionlimit(MAX_N)

N = int(sys.stdin.readline())
A = [int(x) for x in sys.stdin.readline().split()]
E = [[] for _ in range(N)]  # 辺の情報

for _ in range(N-1):
    u, v = map(int, sys.stdin.readline().split())
    E[u-1].append(v-1)
    E[v-1].append(u-1)

lis = [INF] * N
ans = [0] * N 

def dfs(u,r=-1):

    # u を訪れたときの処理
    i = bisect.bisect_left(lis, A[u])  # 
    old = lis[i]  # 書き換え前の値を一時保存
    lis[i] = A[u]

    for v in E[u]:
        if v == r: continue  # 親は無視

        dfs(v,u)
    
    ans[u] = bisect.bisect_left(lis,INF-1)
    lis[i] = old  # 書き換え前の状態に戻す

dfs(0)
for i in range(N):
    print(ans[i])
# -*- coding:utf-8 -*-
"""考え方
よくわからんけど、縦か横の直線で分割する？
あと原点から(x,y)座標へ向けて斜めに分割する奴も考える

"""
def solve():
    W, H, x, y = list(map(int, input().split()))

    # 縦に分割する場合
    ans1 = min(x*H, (W-x)*H)

    # 横に分割する場合
    ans2 = min(W*y, W*(H-y))

    # 斜めに分割する場合
    d = y/x
    if d <= 1:
        # 傾きが1以下の場合
        ans3 = W * (W*d) / 2
    else:
        # 傾きが1より大きい
        d = x/y
        ans3 = H * (H*d) / 2

    ans = max(ans1, ans2, ans3)

    if ((ans==ans1 and ans1==ans2) or 
       (ans==ans2 and ans2==ans3) or 
       (ans==ans3 and ans3==ans1)):
        is_multi = 1
    else:
        is_multi = 0

    print(ans, is_multi)


if __name__ == "__main__":
    solve()


### FIXED CODE ###

# -*- coding:utf-8 -*-
"""考え方
(x, y)と長方形の中心を両方通るような直線で分割すると、大きくない方の面積は全体の半分の面積。

・与えられた(x, y)が長方形の中心の場合、区切り方は無限にある。
・与えられた(x, y)が長方形の中心でない場合、一通りに求まる。
"""
def solve():
    W, H, x, y = list(map(int, input().split()))

    ans_area = W*H/2

    if x == W/2 and y == H/2:
        is_multi = 1
    else:
        is_multi = 0
    
    print(ans_area, is_multi)

if __name__ == "__main__":
    solve()
n = input()
l = list(map(int,input().split(" ")))
 
count = 0
 
while True:
  for i in range(n):
    if l[i]%2 == 0:
      l[i] = l[i]//2
    else:
      print(count)
      break
  count += 1
 

### FIXED CODE ###

n = int(input())
l=list(map(int,input().split()))
count=0
while True:
    for i in range(n):
        if l[i]%2==0:
            l[i]=l[i]//2
        else:
            print(count)
            exit()
    count+=1
n = int(input())
s_dict = {}

for _ in range(n):
  s = input()
  if s_dict.get(s, -1) == -1:
    s_dict[s] = 1
  else:
    s_dict[s] += 1

if len(s_dict) == 1:
  print(s_dict.keys())
  exit()
  
s_dict2 = sorted(s_dict.items(), key=lambda x:x[1], reverse=True)
s_list = [s_dict2[0][0]]
i = 0
while s_dict2[i][1] == s_dict2[i+1][1]:
  s_list.append(s_dict2[i+1][0])
  i += 1
  
s_list.sort()
for i in range(len(s_list)):
  print(s_list[i])


### FIXED CODE ###

n = int(input())
s_dict = {}

for _ in range(n):
  s = input()
  if s_dict.get(s, -1) == -1:
    s_dict[s] = 1
  else:
    s_dict[s] += 1

if len(s_dict) == 1:
  print(list(s_dict.keys())[0])
  exit()
  
s_dict2 = sorted(s_dict.items(), key=lambda x:x[1], reverse=True)
s_list = []
i = 0

while s_dict2[i][1] == s_dict2[0][1]:
  s_list.append(s_dict2[i][0])
  i += 1
  if i == len(s_dict2):
    break

s_list.sort()
for i in range(len(s_list)):
  print(s_list[i])
n = int(input())
s = input()
for i in range(len(s)):
  s[i] = chr(ord((s[i]-65+n) % 26 + 65))
print(s)

### FIXED CODE ###

n = int(input())
s = list(input())
for i in range(len(s)):
  s[i] = chr((ord(s[i])-65+n) % 26 + 65)
print("".join(s))
s = int(input()) 
 
if 400 <= s < 599:
  print("8")
elif  600 <= s <799:
        print("7")
elif  800 <= s <999:
        print("6")
elif  1000 <= s <1199:
        print("5")
elif  1200 <= s <1399:
        print("4")
elif  1400 <= s <1599:
        print("3")
elif  1600 <= s <1799:
        print("2")
else  1800 <= s <1999:
        print("1")

### FIXED CODE ###

s = int(input()) 
 
if 400 <= s <= 599:
  print("8")
elif  600 <= s <=799:
        print("7")
elif  800 <= s <=999:
        print("6")
elif  1000 <= s <=1199:
        print("5")
elif  1200 <= s <=1399:
        print("4")
elif  1400 <= s <=1599:
        print("3")
elif  1600 <= s <=1799:
        print("2")
elif  1800 <= s <=1999:
        print("1")
a,b,c=map(int,input().pslit(' '))
print(a+b+c-max(a,max(b,c)))

### FIXED CODE ###

a,b,c=map(int,input().split(' '))
print(a+b+c-max(a,max(b,c)))
s=int(open(0));v=10**9;y=-s%v;print(0,0,v,1,y,(s+y)//v)


### FIXED CODE ###

#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys, math, bisect, random, itertools
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A(s):
    def pri(n, x):
        if n == 0:
            return [0, 0]
        if n == 1:
            return [1, 1]
        if n == 2:
            return [2, 1]
        for i in range(2, int(math.sqrt(n))):
            if n % i == 0 and n // i <= x:
                return [i, n // i]
        return [1, n]
    x = int(math.sqrt(s))
    if s < 10 ** 9:
        print(0, 0, 0, s, 1, 0)
        return
    while 1:
        X = x ** 2
        if X - s < 0:
            x += 1
            continue
        b = pri(X - s, x)
        if b:
            print(0, 0, x, int(b[0]), int(b[1]), x)
            if x > 10 ** 9 or b[0] > 10 ** 9 or b[1] > 10 ** 9:
                print(s)
                quit()
            return
        x += 1
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return



#Solve
if __name__ == '__main__':
    A(II())
import numpy as np
x=int(input())
a=[100,101,102,103,104,105]
m=[1000000]*6
dplist = np.ones((7,x+1))*(-1)
dplist[0,0] = 0
for i in range(6):
    for j in range(x+1):
        if dplist[i,j] >= 0:
            dplist[i+1,j] = m[i]
        elif dplist[i+1,j-a[i]]<= 0:
            dplist[i+1,j] = -1
        elif j - a[i] < 0:
            dplist[i+1,j] = -1
        else:
            dplist[i+1][j] = dplist[i+1,j-a[i]] -1

if dplist[6,x] >= 0:
    print(1)
else:
    print(0)


### FIXED CODE ###

import numpy as np
x=int(input())
if x<=99:
    print(0)
    exit()
elif x==100 or x==101 or x==102:
    print(1)
    exit()
a=[100,101,102,103,104,105]
m=[1000000]*6
dplist = np.ones((7,x+1))*(-1)
dplist[0,0] = 0
for i in range(6):
    for j in range(x+1):
        if dplist[i,j] >= 0:
            dplist[i+1,j] = m[i]
        elif dplist[i+1,j-a[i]]<= 0:
            dplist[i+1,j] = -1
        elif j - a[i] < 0:
            dplist[i+1,j] = -1
        else:
            dplist[i+1][j] = dplist[i+1,j-a[i]] -1

if dplist[6,x] >= 0:
    print(1)
else:
    print(0)
def main():
    input = input()
    if 0 <= input < 86400:
        hour = int(input / 3600)
        minute = int((input / 60) % 60)
        seconde = int(input % 60)
        print("%d:%d:%d" % (hour,minute,seconde))

if __name__ == "__main__":
    main()

### FIXED CODE ###

input = int(input())
if 0 <= input < 86400:
    hour = input / 3600
    minute = (input / 60) % 60
    second = input % 60
    print("%d:%d:%d" % (hour,minute,second))
from sys import stdin

a,b,k= [int(x) for x in stdin.readline().rstrip().split()]

li = [i for i in range(a,b+1)]

lin = []

for i in range(k):
    lin.append(li[i])
    lin.append(li[len(li)-i-1])

lin = list(set(lin))
lin.sort()

for i in lin:
    print(i)

### FIXED CODE ###

from sys import stdin
a,b,c = [int(x) for x in stdin.readline().rstrip().split()]
if b-a < c*2:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+c):
        print(i)
    for j in range(b-c+1,b+1):
        print(j)
a=input()
b=input()
print a*b
print a*2+b*2

### FIXED CODE ###

a,b=map(int,raw_input().split())
if 0<=b<=100 and 0<=b<=100:
    print a*b,
    print a*2+b*2
else:
    pass
from collections import deque

z=list(input())
Q=deque()
Q.append((z))
q=int(input())

cnt=0

for i in range(q):
  x=input()
  if x[0]=='1':
    cnt+=1
    cnt%=2
    
  elif x[0]=='2':
    if x[2]=='1':
        if cnt%2==0:
            Q.appendleft(x[4])
        else:
            Q.append(x[4])

    else:
        if cnt%2==0:
            Q.append(x[4])
        else:
            Q.appendleft(x[4])
      
if cnt%2==1:
  Q.reverse()


print(''.join(Q))

### FIXED CODE ###

from collections import deque


Q=deque(list(input()))

q=int(input())

cnt=0

for i in range(q):
  x=input()
  if x[0]=='1':
    cnt+=1
    cnt%=2
    
  elif x[0]=='2':
    if x[2]=='1':
        if cnt%2==0:
            Q.appendleft(x[4])
        else:
            Q.append(x[4])

    else:
        if cnt%2==0:
            Q.append(x[4])
        else:
            Q.appendleft(x[4])
      
if cnt%2==1:
  Q.reverse()


print(''.join(Q))
x = input()
print(x**3)

### FIXED CODE ###

x = input()
i = int(x)
print(i**3)
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for a in range(A+1):
  　　for b in range(B+1):
    　　　　for c in range(C+1):
      　　　　　　value = 500*a + 100*b + 50*c 
      　　　　　　if value == X :
        　　　　　	ans += 1
        　　　　　	print(a, b, c)
        

print(ans)

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      value = 500*a + 100*b + 50*c 
      if value == X:
      	ans += 1
print(ans)
N, K = map(int, input().split())
A = list(map(int, input().split()))
l = A[0]
r = A[K]
for i in range(K-2):
  if l < r:
    print(l,r)
    print('Yes')
  else:
    print(l,r)
    print('No')
  l = A[1+i]
  r = A[K+1+i]
if l < r:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

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