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

for i in range(n):
    cmd=input().split()
    if cmd[0]=="insert":
        dl_list.insert(0,cmd[1])
    elif cmd[0]=="delete":
        try:
            dl_list.remove(cmd[1])
        except:
            print("Error")
    elif cmd[0]=="deleteFirst":
        del dl_list[0]
    elif cmd[0]=="deleteLast":
        del dl_list[-1]

print(*dl_list)

### FIXED CODE ###

from collections import deque
n=int(input())
dq=deque()

for i in range(n):
    cmd=input().split()
    if cmd[0]=="insert":
        dq.appendleft(cmd[1])
    elif cmd[0]=="deleteFirst":
        dq.popleft()
    elif cmd[0]=="deleteLast":
        dq.pop()
    elif cmd[0]=="delete":
        try:
            dq.remove(cmd[1])
        except:
            pass
print(*dq)
inputa = list(map(int, input().split()))

S = inputa[0] * inputa[1] / 2

# W:H = x:y
# Hx = yW
# y = (H/W)x

if W / 2 == x:
  if H / 2 == y:
    print (S, " 1")
    exit(0)
print (S, " 0")

### FIXED CODE ###

inputa = list(map(int, input().split()))
 
S = inputa[0] * inputa[1] / 2
 
if inputa[0] / 2 == inputa[2]:
  if inputa[1] / 2 == inputa[3]:
    print (S, " 1")
    exit(0)
print (S, " 0")
A,B,C,K=map(int,input().split())
if (A>=K):
  print(K)
else:
  K = K-A
  if (B>=D):
    print(A)
  else:
    K = K-B
    print(A-K)

### FIXED CODE ###

S=input()
T=input()
if (S==T[:len(T)-1]):
  print("Yes")
else:
  print("No")
import collections
n = int(input())
v = list(map(int, input().split()))
ve = v[0::2]
vo = v[1::2]
# print(ve,vo)

ce=collections.Counter(vo).most_common(2)
co=collections.Counter(ve).most_common(2)

if(ce[0][0] != co[0][0]):
    ans = len(v) - ce[0][1] - co[0][1]
elif(len(ce)==1 and len(co)==1):
    ans = len(v) // 2
elif(len(ce)==1):
    ans = len(v) // 2 - co[1][1]
elif(len(co)==1):
    ans = len(v) // 2 - ce[1][1]
print(ans)


### FIXED CODE ###

import collections
n = int(input())
v = list(map(int, input().split()))
ve = v[0::2]
vo = v[1::2]
# print(ve,vo)

ce=collections.Counter(vo).most_common(2)
co=collections.Counter(ve).most_common(2)

if(ce[0][0] != co[0][0]):
    ans = len(v) - ce[0][1] - co[0][1]
elif(len(ce)==1 and len(co)==1):
    ans = len(v) // 2
elif(len(ce)==1):
    ans = len(v) // 2 - co[1][1]
elif(len(co)==1):
    ans = len(v) // 2 - ce[1][1]
else:
    ans = len(v) - max( ce[0][1]+co[1][1], ce[1][1]+co[0][1])

print(ans)
S=str(input())
if len(set(S))=1:
  print("No")
 else:
  print(Yes)

### FIXED CODE ###

S=str(input())
if len(set(S))==1:
  print("No")
else:
  print("Yes")
N,M = map(int,input().split())
count = 0
for i in range(M):
    a,b = map(int,input().split())
    if count == 0:
        min = a
        max = b
        count = 1
    else:
        if min < a && a<max:
            min =a
        else:
            break
    if max > b && b >min:
        max = b
    else:
            break
if M == i+1:
    print(max-min+1)
else:
    print(0)

### FIXED CODE ###

N,M = map(int,input().split())
count = 0
for i in range(M):
    a,b = map(int,input().split())
    if count == 0:
        L = a
        R = b
        count = 1
    else:
        if L < a:
            L =a
            if L>R:
                break
        if R > b:
            R = b
            if R < L:
                break
if M == i+1:
    print(R-L+1)
else:
    print(0)
n,m=map(int,input().split())

a=[1,1]
for i in range(2,10000):
    a.append((a[i-1]+a[i-2])%1000000007)

bad=[]
for i in range(m):
    bad.append(int(input()))
num=[]
before=0
bad_flag=0

if m!=0:
    for i in range(len(bad)):
        nxt=bad[i]-before-1
        if nxt==-1:
            bad_flag=1
            break
        num.append(nxt)
        before=bad[i]+1
    num.append(n-bad[len(bad)-1]-1)
else:
    num.append(n)
if bad_flag:
    print(0)
else:
    ans=0
    last=1
    for i in num:
        ans=a[i]*last
        last=ans%1000000007
    print(last)

### FIXED CODE ###

n,m=map(int,input().split())

a=[1,1]
for i in range(2,100001):
    a.append((a[i-1]+a[i-2])%1000000007)

bad=[]
for i in range(m):
    bad.append(int(input()))
num=[]
before=0
bad_flag=0

if m!=0:
    for i in range(len(bad)):
        nxt=bad[i]-before-1
        if nxt==-1:
            bad_flag=1
            break
        num.append(nxt)
        before=bad[i]+1
    num.append(n-bad[len(bad)-1]-1)
else:
    num.append(n)
if bad_flag:
    print(0)
else:
    ans=0
    last=1
    for i in num:
        ans=a[i]*last
        last=ans%1000000007
    print(last)
i = input().split()
a = int(x(1))
b = int(x(-1))
print(a*b, (a+b)*2)

### FIXED CODE ###

x = input().split()
a = int(x[0])
b = int(x[1])
print(a*b, (a+b)*2)
def solve(n):
    global N, K
    dp = [[0] * (K + 1) for _ in range(N + 1)]
    dp[0][0] = 1
    for i in range(N):
        a = 0 if i == n else A[i]
        for j in range(K + 1):
            dp[i + 1][min(K, j + a)] |= dp[i][j]
            dp[i + 1][j] |= dp[i][j]
    rst = any(dp[N][k] for k in range(K - A[n], K))
    return rst


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


# [ok, ng) - Maximum
# (ng, ok] - Minimum
# ok が 最終的な答え
ok = N
ng = -1
while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if solve(mid):
        ok = mid
    else:
        ng = mid
print(ok)


### FIXED CODE ###

def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort()


    # [ok, ng) - Maximum
    # (ng, ok] - Minimum
    # ok が 最終的な答え
    ok = N
    ng = -1
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        n = mid
        dp = [0] * (K + 1)
        dp[0] = 1
        for i in range(N):
            a = A[i]
            if i == n or a >= K:
                continue
            for j in range(K, -1, -1):
                dp[min(K, j + a)] |= dp[j]
        rst = any(dp[k] for k in range(max(0, K - A[n]), K))
        if rst:
            ok = mid
        else:
            ng = mid
    print(ok)


main()
# -*- coding: utf-8 -*-
import sys
N,M=map(int, sys.stdin.readline().split())
A=map(int, sys.stdin.readline().split())
BC=[]   #カードの値、枚数
for _ in range(M):
    b,c=map(int, sys.stdin.readline().split())
    BC.append([c,b])

A.sort()
BC.sort(reverse=True)

NEW_A=[]
idx=0   #BCリストのインデックス
for a in A:
    new_value=BC[idx][0]
    if a<new_value:
        NEW_A.append(new_value)
        BC[idx][1]-=1   #個数を-1
    else:
        NEW_A.append(a)
    try:
        if BC[idx][1]==0:
            idx+=1
    except:
        break

print sum(NEW_A)

### FIXED CODE ###

import sys

N,M=map(int, sys.stdin.readline().split())
A=map(int, sys.stdin.readline().split())
A.sort()

B=[ map(int, sys.stdin.readline().split()) for _ in range(M)] 
B.sort(key=lambda x: x[1], reverse=True)

i=0

for b,c in B:
	for i in range(i,N):
		if A[i]<c and 0<b:
			A[i]=c
			b-=1
		if b==0:
			break
	i+=1

print sum(A)
s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
if s < t:
    print("yes")
else:
    print("No")

### FIXED CODE ###

a,b = map(int,input().split())
y = (a + b)/ 2
import math
print(math.ceil(y))
a, b, c = map(int, raw_input().split())
sum = 0
for i in range(a, b):
   if c % i == 0:
      sum = sum + 1
   else
      sum = sum
print sum

### FIXED CODE ###

a, b, c = map(int, raw_input().split())
sum = 0
for i in range(a, b+1):
   if c % i == 0:
      sum = sum + 1
print sum
N, M = [int(i) for i in input().split()]

PY = []
PYd = {i:[] for i in range(1, N+1)}

for i in range(M):
    x, y = [int(i) for i in input().split()]
    PYd[x].append(y)
    PY.append((x,y))
    
for i in PYd.keys():
    PYd[i].sort()
    
for p,y in PY:
    str_p = str(p).zfill(6)
    index = str(bisect.bisect(PYd[p], y)).zfill(6)
    print(str_p+index)

### FIXED CODE ###

from collections import defaultdict
import bisect

N, M = [int(i) for i in input().split()]

PY = []
PYd = defaultdict(list)

for i in range(M):
    x, y = [int(i) for i in input().split()]
    PYd[x].append(y)
    PY.append((x,y))
    
for i in PYd.keys():
    PYd[i].sort()
    
for p,y in PY:
    str_p = str(p).zfill(6)
    index = str(bisect.bisect(PYd[p], y)).zfill(6)
    print(str_p+index)
n = list(map(int, input().split()))
N = n[0]
K = n[1]

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

num = [i for i in range(1,10)]

dd = []

for i in d:
  num.remove(i)

a = 0
for i in num:
  a += i*1000
print(a)

### FIXED CODE ###

N,K=map(int,input().split())
D=list(map(int,input().split()))
def solve():
  for i in range(10*N+2):
    if i>=N:
      s=str(i)
      for j in range(len(s)):
        if int(s[j]) in D: break
      else:
        print(i)
        return 0
 
solve()
# -*- coding: utf-8 -*-

N=int(input())
ans=0
if(N%2==0)
   ans=N
else
   ans=N*2

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
N=int(input())
ans=0
if N%2==0:
   ans=N
else:
   ans=N*2
 
print(ans)
x = int(input())
 
for val in range(x, x**1000) :
	if x ==2 :
		print(x)
		break
	elif ((10** val) % val) == 10 :
		print (val)
		break
	else :
		continue

### FIXED CODE ###

S, T = (str(i) for i in input().split())

U = T + S
print(U)
S=input()
if S==SUN:
  print('7日後')
elif S==MON:
  print('6日後')
elif S==TUE:
  print('5日後')
elif S==WED:
  print('4日後')
elif S==THU:
  print('3日後')
elif S==FRI:
    print('2日後')
else:
    print('1日後')

### FIXED CODE ###

S=input()
if S=='SUN':
  print('7')
elif S=='MON':
  print('6')
elif S=='TUE':
  print('5')
elif S=='WED':
  print('4')
elif S=='THU':
  print('3')
elif S=='FRI':
  print('2')
else:
  print('1')
import numpy as np
n = int(input())
for i in range(n):  
    if(n%2==0):
        break
    count=0
    for j in range(2,int(np.sqrt(i))+1):
        if(i%j == 0):
            count += 1
        if(count == 7):
            break
print(count)



### FIXED CODE ###

import numpy as np
n = int(input())
ans =0
for i in range(1,n+1):  
    if(i%2==0):
        continue
    count=0
    for j in range(1,i+1):
        if(i%j == 0):
            count += 1
    if(count == 8):
            ans+=1
print(ans)
s = input()

x = int(s[0:2])
y = int(s[3:])

if x > 12:
    if y > 12:
        print("NA")
    elif y >= 1:
        print("YYMM")
    else:
        print("NA")
elif x >= 1
    if y > 12:
        print("MMYY")
    elif y >= 1:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if y > 12:
        print("NA")
    if y >= 1:
        print("YYMM")
    else:
        print("NA")
        

### FIXED CODE ###

s = input()

x = int(s[0:2])
y = int(s[2:])

if x > 12:
    if y > 12:
        print("NA")
    elif y >= 1:
        print("YYMM")
    else:
        print("NA")
elif x >= 1:
    if y > 12:
        print("MMYY")
    elif y >= 1:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if y > 12:
        print("NA")
    if y >= 1:
        print("YYMM")
    else:
        print("NA")
while True:
  for j in range(N):
    if x[j] % 2 == 0:
      x[j] /= 2
    else:
      K = 0
      break
  
  else:
    count += 1
  if K==0:
    break

print(count)

### FIXED CODE ###

N = int(input())
x = list(map(int,input().split()))
count = 0
K = None

while True:
  for j in range(N):
    if x[j] % 2 == 0:
      x[j] /= 2
    else:
      K = 0
      break
  
  else:
    count += 1
  if K==0:
    break

print(count)
def main():
    h, w = map(int, input().split())

    m = []
    wall = ['.' for _ in range(w + 2)]
    m.append(wall)
    for _ in range(w):
        r = ["."] + list(input()) + ["."]
        m.append(r)
    m.append(wall)

    for i in range(1, h + 1):
        for j in range(1, w + 1):
            if m[i][j] == '#':
                f = any([m[i + x][j + y] == "#" for (x, y) in ((1, 0), (-1, 0), (0, 1), (0, -1))])
                if not f:
                    print("No")
                    exit()
    else:
        print("Yes")


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    h, w = map(int, input().split())

    m = []
    wall = ['.' for _ in range(w + 2)]
    m.append(wall)
    for _ in range(h):
        r = ["."] + list(input()) + ["."]
        m.append(r)
    m.append(wall)

    for i in range(1, h + 1):
        for j in range(1, w + 1):
            if m[i][j] == '#':
                f = any([m[i + x][j + y] == "#" for (x, y) in ((1, 0), (-1, 0), (0, 1), (0, -1))])
                if not f:
                    print("No")
                    exit()
    else:
        print("Yes")


if __name__ == '__main__':
    main()
import heapq

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

sum1 = 0
sum2 = 0
left = []
used = set()
unused = []

for i in range(n):
    sum1 += a[i]
    heapq.heappush(left, (a[i], i))


for v, i in sorted((a[i], i) for i in range(n, n * 3)):
    if len(used) < n:
        sum2 += v
        used.add((v, i))
    else:
        heapq.heappush(unused, (v, i))

print(sum1, sum2)
ans = sum1 - sum2
for i in range(n, 2 * n):
    # v1: これから挿入しようとしている値
    # v2: 現状の最小値
    v1 = a[i]
    v2, j = left[0]
    if v2 < v1:
        sum1 = sum1 + v1 - v2
        heapq.heappop(left)
        heapq.heappush(left, (v1, i))

    # v1: これから削除する可能性がある値
    # v2: 候補のうちで最小の値
    while True:
        v2, j = unused[0]
        if i < j:
            break
        heapq.heappop(unused)
        
    if (v1, i) in used:
        sum2 = sum2 - v1 + v2
        used.remove((v1, i))
        used.add((v2, j))
        heapq.heappop(unused)

    ans = max(ans, sum1 - sum2)

print(ans)
    
    

### FIXED CODE ###

import heapq

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

sum1 = 0
sum2 = 0
left = []
used = set()
unused = []

for i in range(n):
    sum1 += a[i]
    heapq.heappush(left, (a[i], i))


for v, i in sorted((a[i], i) for i in range(n, n * 3)):
    if len(used) < n:
        sum2 += v
        used.add((v, i))
    else:
        heapq.heappush(unused, (v, i))

ans = sum1 - sum2
for i in range(n, 2 * n):
    # v1: これから挿入しようとしている値
    # v2: 現状の最小値
    v1 = a[i]
    v2, j = left[0]
    if v2 < v1:
        sum1 = sum1 + v1 - v2
        heapq.heappop(left)
        heapq.heappush(left, (v1, i))

    # v1: これから削除する可能性がある値
    # v2: 候補のうちで最小の値
    while True:
        v2, j = unused[0]
        if i <= j:
            break
        heapq.heappop(unused)
        
    if (v1, i) in used:
        sum2 = sum2 - v1 + v2
        used.remove((v1, i))
        used.add((v2, j))
        heapq.heappop(unused)

    ans = max(ans, sum1 - sum2)

print(ans)
import math
x1,y1,x2,y2=map(int,input().split())
print(math.sqrt((x2-x1)**2+(y2-y1**2)))

### FIXED CODE ###

x1,y1,x2,y2=map(float,input().split())
print("%.6f"%((x2-x1)**2+(y2-y1)**2)**0.5)
import sys
a,b,c = map(int,sys.stdin.readline().split())
if a < b && b < c:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

import sys
a,b,c = map(int,sys.stdin.readline().split())
if (a < b and b < c):
    print("Yes")
else:
    print("No")
s = input()
print(s[0] + len(s[1:len(s) - 1]) + s[len(s) - 1]

### FIXED CODE ###

s = input()
print(s[0] + str(len(s[1:len(s) - 1])) +  s[len(s) - 1])
r, g, b, n = map(int, input().split())
ball = [0, r, g, b]
count = 0

for i in range(n+1):
    for j in range(n+1):
        m = math.floor((n-i*r-j*g)/b)
        if i*r+j*g+m*b == n and m >= 0:
            count += 1
            #print(i, j, m)
print(count)

### FIXED CODE ###

r, g, b, n = map(int, input().split())
ball = [0, r, g, b]
dp = [[0] * 4 for _ in range(n+1)]
dp[0][0] = 1

for i in range(n+1):
    for k in range(4):
        if k == 0:
            if i != 0:
                dp[i][k] = 0
        else:
            if i - ball[k] < 0:
                dp[i][k] = dp[i][k-1]
            else:
                dp[i][k] = dp[i-ball[k]][k] + dp[i][k-1]

print(dp[n][3])
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


import math
n,m = map(int, input().split())
s = input()
t = input()
g = math.gcd(n,m)
d = defaultdict(list)
for i in range(n):
    ind = i*(m//g)
    d[ind].append(s[i])
for i in range(m):
    ind = i*(n//g)
    d[ind].append(t[i])
for k,v in d.items():
    if v and not all(item==v[0] for item in v):
        ans = -1
        break
else:
    ans = n*m//g
print(ans)

### FIXED CODE ###

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")

from collections import defaultdict
import math
n,m = map(int, input().split())
s = input()
t = input()
g = math.gcd(n,m)
d = defaultdict(list)
for i in range(n):
    ind = i*(m//g)
    d[ind].append(s[i])
for i in range(m):
    ind = i*(n//g)
    d[ind].append(t[i])
for k,v in d.items():
    if v and not all(item==v[0] for item in v):
        ans = -1
        break
else:
    ans = n*m//g
print(ans)
N = input()
a = [input() for i in range(N)]
print(a);

### FIXED CODE ###

n = 6;
a = [input() for i in range(n)];
 
k = a[-1];
ans = "Yay!";
 
for i in range(n-1):
  for j in reversed(range(n-1)):
    if k < a[i] - a[j]:
      ans = ":( ";
      break;
print ans;
----

### FIXED CODE ###

S = str(input())
p = S.count('+') 
m = S.count('-')
print(p-m)
# -*- coding: utf-8 -*-

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

if (a * b) % 2:
    print('Odd')
else:
    print('Even')


### FIXED CODE ###

# -*- coding: utf-8 -*-

r, g, b = map(int, list(input().split()))

num = r * 100 + g * 10 + b

if num % 4:
    print('NO')
else:
    print('YES')
a = input()
b = input()
print(6-a+b)

### FIXED CODE ###

a = int(input())
b = int(input())
print(6-a-b)
=int(input())
b=int(input())
c=int(input())
m=int(input())
s=0
for i in range(a+1):
  for j in range(b+1):
    x,y=divmod(m-i*500-j*100,50)
    if y==0 and 0<=x<=c:
      s+=1
print(s)

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
m=int(input())
s=0
for i in range(a+1):
  for j in range(b+1):
    x,y=divmod(m-i*500-j*100,50)
    if y==0 and 0<=x<=c:
      s+=1
print(s)
N=int(input())
T=[int(i) for i in raw_input().split()]
M=int(input())

for i in range(M):
    p,x=map(int,raw_input().split())
    time=sum(T)-T[p-1]+x
    print(time)


### FIXED CODE ###

N=int(input())
T=list(map(int,input().split()))
M=int(input())
P=[]
X=[]
for k in range(M):
    p,x=map(int,input().split())
    P.append(p)
    X.append(x)

for h in range(M):
    time=sum(T)-T[P[h]-1]+X[h]
    print(time)
n,Xmax=map(int,input().split())
L=list(map(int,input().split()))
x=0
count=0
while x<Xmax:
  x+=L.pop(0)
  count+=1
print(count)

### FIXED CODE ###

n,Xmax=map(int,input().split())
L=list(map(int,input().split()))
x=0
count=1
while x+L[0]<=Xmax:
  count+=1
  x+=L.pop(0)
  if len(L)==0:
    break
print(count)
l = map(int,raw_input().split())

print(l[0]*l[1])
print(" ")
print(l[0]*2+[1]*2)

### FIXED CODE ###

l = map(int,raw_input().split())

print(str(l[0]*l[1])+" "+str((l[0]+l[1])*2))
N, K = map(int, input().split())
import math


def fact(n):
    if n == 0 or n == 1:
        return 1
    else:
        return n * fact(n-1)

def nCr(n, r):
    return fact(n) // fact(n - r) * fact(r))
 
for j in range(K):
  if (2*j+1)>N:
    print(0)
  else:
    x = (nCr((K-1), j) * nCr(N-K+1, j+1))
    if (x > (10**9+7)):
         print(x%(10**9+7))
    else:
         print(x)


### FIXED CODE ###

N, K = map(int, input().split())
from operator import mul
from functools import reduce
 
def nCr(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
 
for j in range(K):
  if (K+j)>N:
    print(0)
  else:
    x = (nCr((K-1), j) * nCr(N-K+1, j+1))
    if (x > (10**9+7)):
         print(x%(10**9+7))
    else:
         print(x)
N, M = map(int, input().split())
L1, R1 = map(int, input().split())
flag = 0
def find_key(L1,R1,L2,R2):
  if R1 < L2 or R2 < L1:
    print(0)
    flag = 1
    break
  else:
    a = [R1,L1,R2,L2]
    a.sort()
    return(a[1],a[2])

for i in range(M - 1):
  L,R = map(int, input().split())
  L1,R1 = find_key(L1,R1,L,R)
if flag == 1:
  print(L1,R1)

### FIXED CODE ###

A,B = map(int,input().split())
print(B if A >= 13 else 0 if A  <= 5 else B//2)
N = int(input())
A = list(int(i) for i in input().split())

A.sort()


if((A[1] - A[0]) == 0):
    min_HP = A[0]
    print(min_HP)
else:
    min_HP = A[1] - A[0]
    while((A[1] - A[0]) > 0):
        A.insert(0, A[1] - A[0])
        A.sort()
        if((A[1] - A[0]) == 0):
            break
        min_HP = A[1] - A[0]

    # そのループでまだmin_HPが更新されていない
    min_flag = False
    while(True):
        for a in A:
            if ((a % min_HP) < min_HP and (a % min_HP) > 0):
                min_HP = tmp_min
                min_flag = True
        if( min_HP > 0 and min_flag ):
            continue
        else:
            break
    print(min_HP)

### FIXED CODE ###

N = int(input())
A = list(int(i) for i in input().split())

A.sort()


if((A[1] - A[0]) == 0):
    min_HP = A[0]
    print(min_HP)
else:
    min_HP = A[1] - A[0]
    while((A[1] - A[0]) > 0):
        A.insert(0, A[1] - A[0])
        A.sort()
        if((A[1] - A[0]) == 0):
            break
        min_HP = A[1] - A[0]

    # そのループでまだmin_HPが更新されていない
    while(True):
        min_flag = False
        for a in A:
            if ((a % min_HP) < min_HP and (a % min_HP) > 0):
                min_HP = a % min_HP
                min_flag = True
        if( min_HP > 0 and min_flag ):
            continue
        else:
            break
    print(min_HP)
S = str(input())
N = int(input())
q = (N -1) // 5
mod = N % 5
if N == 25:
    print(S[4]+S[4])
else:
    print(S[q]+S[mod-1])


### FIXED CODE ###

S = str(input())
if S[0] == S[1] == S[2] or S[1] == S[2] == S[3]:
    print("Yes")
else:
    print("No")
import time
start = time.time()
a, b, c = map(int, input().split())

cnt = 0
a_list = [0]*(1001001)
b_list = [0]*(1001001)
c_list = [0]*(1001001)
a_list[0] = a
b_list[0] = b
c_list[0] = c

for i in range(1, 10**9):
    a_list[i] = (b_list[i-1] + c_list[i-1]) // 2
    b_list[i] = (c_list[i-1] + a_list[i-1]) // 2
    c_list[i] = (a_list[i-1] + b_list[i-1]) // 2
    cnt += 1
    if a_list[i] % 2 != 0 or b_list[i] % 2 != 0 or c_list[i] % 2 != 0:
        break
    if time.time() - start >= 1.5:
        cnt = -1
        break

print(cnt)


### FIXED CODE ###

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

if any(i % 2 != 0 for i in [a, b, c]):
    print(0)
    exit()

if a == b and b == c:
    print(-1)
    exit()

cnt = 0
a_list = [0]*(1001001)
b_list = [0]*(1001001)
c_list = [0]*(1001001)
a_list[0] = a
b_list[0] = b
c_list[0] = c

for i in range(1, 1001001):
    a_list[i] = (b_list[i-1] + c_list[i-1]) // 2
    b_list[i] = (c_list[i-1] + a_list[i-1]) // 2
    c_list[i] = (a_list[i-1] + b_list[i-1]) // 2
    cnt += 1
    if a_list[i] % 2 != 0 or b_list[i] % 2 != 0 or c_list[i] % 2 != 0:
        break

print(cnt)
N,K=map(int, input().split())

class UnionFindTree:
    def __init__(self, n):
        self.nodes = list(range(n+1))
    def find(self, x):
        if self.nodes[x] == x:
            return x
        parent = self.find(self.nodes[x])
        self.nodes[x] = parent
        return parent
    def unite(self, a, b):
        a = self.find(a)
        b = self.find(b)
        if a == b:
            return
        self.nodes[a] = self.nodes[b]
    def is_same(self, a, b):
        return self.find(a) == self.find(b)

uf = UnionFindTree(N)
for i in range(K):
    i,j,k=map(int, input().split())
    uf.unite(i,j)

st = set()
for i in range(1,N+1):
    par = uf.find(i)
    st.add(par)

print(len(st))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)
N,K=map(int, input().split())

class UnionFindTree:
    def __init__(self, n):
        self.nodes = list(range(n+10))
    def find(self, x):
        if self.nodes[x] == x:
            return x
        parent = self.find(self.nodes[x])
        self.nodes[x] = parent
        return parent
    def unite(self, a, b):
        a = self.find(a)
        b = self.find(b)
        if a == b:
            return
        self.nodes[a] = self.nodes[b]
    def is_same(self, a, b):
        return self.find(a) == self.find(b)

uf = UnionFindTree(N)
for i in range(K):
    i,j,k=map(int, input().split())
    uf.unite(i,j)

st = set()
for i in range(1,N+1):
    par = uf.find(i)
    st.add(par)

print(len(st))
S = input()
T = input()
print(T,S,sep='')

### FIXED CODE ###

S,T = input().split()
print(T+S)