Harryxun/stf_run huggingface dataset:
def typing(s, ans):
    for i in range(len(s)):
        if len(ans) != 0:
            continue
        elif s[i] == '0':
            ans.append('0')
        elif s[i] == '1':
            ans.append('1')
        elif s[i] == 'B':
            ans.pop()

    print(''.join(ans))

S = str(input())
ANS = []
typing(S, ANS)

### FIXED CODE ###

def typing(s, ans):
    for i in range(len(s)):
        if s[i] == '0':
            ans += '0'
        if s[i] == '1':
            ans += '1'
        if s[i] == 'B' and ans != '':
            ans = ans[:len(ans)-1]

    print(ans)

S = str(input())
ANS = ''
typing(S, ANS)
# coding: utf-8
# Your code here!
N,X=map(int, input().split())
List=list(map(int, input().split()))
i=0
bow=0
while bow<=X:
    bow+=List[i]
    i+=1
print(i)

### FIXED CODE ###

# coding: utf-8
# Your code here!
N,X=map(int, input().split())
List=list(map(int, input().split()))
bow=0
cnt=1
for i in range(0,N):
    bow+=List[i]
    if bow>X:
        break
    else:
        cnt+=1

print(cnt)
n = int(input())
k = list(map(int,input().split()))
r = 0
for i in range(n):
  if k[k[i]] == i: r += 1
print(r//2)

### FIXED CODE ###

n = int(input())
k = list(map(int,input().split()))
r = 0
for i in range(n):
  if k[k[i]-1] == i+1: r += 1
print(r//2)
import sys
sys.setrecursionlimit(10**7)
 
def calcmore2(num,result,ans):
    while result%10 == 0 and result >= 10:
        result = result / 10
        ans += 1
    if num >= 2:return calcmore2(num-2, num-2, ans)
    else:return ans
 
A = int(input())
ans = 0
ans = calcmore2(A, 1,ans)
print(ans)

### FIXED CODE ###

N = int(input())

ans = 0

if N % 2 == 0:
    num = 5
    temp_N = N//2
    while num <= temp_N:
        ans += temp_N//num
        num *= 5

print(int(ans))
s = input()
arr = [int(i) for i in s.split('')]
result = 0
for j in range(arr):
  result += arr[j]
if(result>=22):
  print("bust")
else:
  print("win")

### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b+c>= 22:
  print("bust")
else:
  print("win")
N = int(input())
B = list(map(int,input.split()))
A = sum(B)*2
for i in range(N-1):
  if B[i] <= B[i+1]:
    A -= B[i+1]
  else:
    A -= B[i]
print(A)

### FIXED CODE ###

N = int(input())
B = list(map(int,input().split()))
A = sum(B)*2
for i in range(N-2):
  if B[i] <= B[i+1]:
    A -= B[i+1]
  else:
    A -= B[i]
print(A)
N = int(input())
X = list(map(input().split()))
P = ceil(sum(X)/2)

hp = 0

for x in X:
  hp_x = (P-X)**2
  hp = hp + hp_x
print(hp)

### FIXED CODE ###

import math
N = int(input())
X = list(map(int,input().split()))
P = math.ceil(sum(X)/N)
P1 = P - 1
hp = 0
hp2 = 0

for x in X:
  hp_x = (P-x)**2
  hp2_x = (P1 - x)**2
  hp = hp + hp_x
  hp2 = hp2 + hp2_x
print(min(hp,hp2))
n = int(input()) 
a = [0 for i in range(15)]
alf = "abcdefghijklmnopqrstuvwxyz" 
hasStarted = False
hasFound = False
for j in range(14, -1, -1):
	rem = n // (26**j)
	if rem == 0:
		continue
	else:
		a[j] = rem
		n -= rem*(26**j)
a.reverse()
res = ""
for c in a:
	if hasStarted:
		if c == 0:
			res += "z"
		else:
			res += alf[c-1]
	else:
		if c != 0:
			res += alf[c-1]
			hasStarted = True

print(res)


### FIXED CODE ###

a = input()
if a.islower():
  print("a")
else:
  print("A")
import heapq

n = int(input())
max_i = 0

while n>6**max_i:
  max_i+=1
  
cand_list = list(set([-6**i for i in range(max_i)] + [-9**i for i in range(max_i)]))

heapq.heapify(cand_list)
counter = 0

while n > 0:
  cand_n = -1 * heapq.heappop(cand_list)
  while n >= cand_n:
    n -= cand_n
    counter += 1
  
print(counter)

### FIXED CODE ###

n = int(input())

counter_min = n

for i in range(n+1):
  counter = 0
  n_six = i
  n_nine = n-i

  # 6
  j = 1
  while True:
    if  n_six >= 6**j:
      j += 1
    else:
      div_n = 6**(j-1)
      break
  
  while n_six > 0:
    counter += n_six // div_n
    n_six %= div_n
    div_n //= 6 
    
  # 9
  j = 1
  while True:
    if  n_nine >= 9**j:
      j += 1
    else:
      div_n = 9**(j-1)
      break
        
  while n_nine > 0:
    counter += n_nine // div_n
    n_nine %= div_n
    div_n //= 9
  
  counter_min = min(counter, counter_min)

print(counter_min)
N,M = map(int,input().split())
LR = [list(map(int,input().split())) for _ in range(N)]
count = 0
for i in range(N):
  for j,k in LR:
    if i >= j and i <= k:
      count += 1
print(count)


### FIXED CODE ###

N,M = map(int,input().split())
L = []
R = []
ans = 0
for _ in range(M):
  l, r = map(int, input().split())
  L.append(l)
  R.append(r)
ans = max(0,min(R) - max(L) + 1)
print(ans)
a b c = map(int, input(),split(''))
print(a + b+ c)

### FIXED CODE ###

s = input()
print(s.count('1'))
import math

r = imput()

print ("%f %f" % (math.pi * r * r, 2 * math.pi * r))

### FIXED CODE ###

import math

r = input()

print("%f %f" % (math.pi * r ** 2, 2 * math.pi * r))
a, b = (int(i) for i in input().split())
if {a,b} == {1,2}:
    print(3)
elif {a,b}=={2,3}:
    print(1)
elif {a,b}== {3,1}:
    print(2)


### FIXED CODE ###

S = []
for _ in range(2):
    S.append(int(input()))  # S += [input()] とも書ける

if {S[0],S[1]} == {1,2}:
    print(3)
elif {S[0],S[1]}=={2,3}:
    print(1)
elif {S[0],S[1]}== {3,1}:
    print(2)
def find_next(room: int, move: int) -> None:
    for next in path[room]:
        if mark[next] != None:
            if mark[next][1] <= move:
                continue
            else:
                mark[next] = (room, move)
                find_next(next, move + 1)
        else:
            mark[next] = (room, move)
            find_next(next, move + 1)


N, M = map(int, input().split())
path = [[] for _ in range(N)]
for i in range(M):
    A_i, B_i = map(int, input().split())
    path[A_i - 1].append(B_i - 1)
    path[B_i - 1].append(A_i - 1)
# print(path)
mark = [None] * N
mark[0] = (0, 0)
find_next(0, 1)
if None in mark:
    print("No")
else:
    print("Yes")
    for i in range(1, len(mark)):
        print(mark[i][0] + 1)    

### FIXED CODE ###

from collections import deque
n, m = map(int,input().split())
AB = [tuple(map(int, input().split())) for _ in range(m)]

def bfs(start):
    queue = deque()
    visited = [False] * n
    visited[start-1] = True
    queue.append(start)
    while queue:
        target = queue.popleft()
        for i in g[target]:
            if not visited[i-1]:
                ans[i-2] = target
                visited[i-1] = True
                queue.append(i)

ans = [0] * (n-1)
g = dict()
for a, b in AB:
    if a in g:
        g[a].append(b)
    if b in g:
        g[b].append(a)
    if a not in g:
        g[a] = [b]
    if b not in g:
        g[b] = [a]
start = 1
bfs(start)
if len([i for i in ans if i == 0]) == 0:
    print("Yes")
    print(*ans, sep="\n")
else:
    print("No")
n = int(input())
h = list(map(int, input().split()))

dp = [float("inf")] * n
dp[0] = 0
dp[1] = abs(h[2] - h[1])

for i in range(1, n ):
    dp[i] =  dp[i - 1] + abs(h[i] - h[i - 1])
    if i > 1:
        dp[i] = min(dp[i], dp[i] + abs(h[i] - h[i - 2]))

print(dp[n-1])

### FIXED CODE ###

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

dp = [float("inf")] * n
dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2, n):
    dp[i] = min(dp[i - 1] + abs(h[i]-h[i - 1]), dp[i - 2] + abs(h[i]-h[i - 2]))

print(dp[n - 1])
import sys
from bisect import bisect_left

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a, b, q = map(int, input().split())
    S = list(int(input()) for _ in range(a))
    T = list(int(input()) for _ in range(b))

    for _ in range(q):
        x = int(input())
        idx_s = bisect_left(S, x)

        kouho_s = []
        if idx_s != 0:
            kouho_s.append(idx_s - 1)
        if idx_s != a:
            kouho_s.append(idx_s)

        res = f_inf
        for idx_s in kouho_s:
            dist = abs(x - S[idx_s])
            now = S[idx_s]
            idx_t = bisect_left(T, now)
            kouho_t = []
            if idx_t != 0:
                kouho_t.append(idx_t - 1)
            if idx_t != b:
                kouho_t.append(idx_t)
            for idx_t in kouho_t:
                dist += abs(now - T[idx_t])
                res = min(res, dist)

        kouho_t = []
        if idx_t != 0:
            kouho_t.append(idx_t - 1)
        if idx_t != b:
            kouho_t.append(idx_t)

        for idx_t in kouho_t:
            dist = abs(x - T[idx_t])
            now = T[idx_t]
            idx_s = bisect_left(S, now)
            kouho_s = []
            if idx_s != 0:
                kouho_s.append(idx_s - 1)
            if idx_s != b:
                kouho_s.append(idx_s)
            for idx_s in kouho_s:
                dist += abs(now - S[idx_t])
                res = min(res, dist)
        print(res)


if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import sys
from bisect import bisect_left

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a, b, q = map(int, input().split())
    S = [-f_inf] + list(int(input()) for _ in range(a)) + [f_inf]
    T = [-f_inf] + list(int(input()) for _ in range(b)) + [f_inf]

    for _ in range(q):
        res = f_inf
        x = int(input())

        idx_s = bisect_left(S, x)
        idx_t = bisect_left(T, x)
        for s in [S[idx_s - 1], S[idx_s]]:
            for t in [T[idx_t - 1], T[idx_t]]:
                d1 = abs(s - x) + abs(s - t)
                d2 = abs(t - x) + abs(t - s)
                res = min(res, d1, d2)
        print(res)


if __name__ == '__main__':
    resolve()
N,K=map(int,input().split())
A=list(map(int,input().split()))

dictS={}
dictS[0]=1

P=475856**524288+1
# P=10**9+7


for n in range (1,N+1):
    if n-1<K:
        dictS[n]=(A[n-1]*dictS[n-1])%P
    else:
        dictS[n]=(A[n-1]*dictS[n-1]/A[n-1-K])%P

    if n>K:
        if dictS[n]>dictS[n-1]:
            print('Yes')
        else:
            print('No')


### FIXED CODE ###

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

for i in range (K,N):
    if A[i]>A[i-K]:
        print('Yes')
    else:
        print('No')
n = int( input( ) )
t = [ int( val ) for val in input( ).split( " " ) ]
q = int( input( ) )
s = [ int( val ) for val in input( ).split( " " ) ]

cnt = 0
for si in s:
	for ti in t:
		if si == ti:
			cnt += 1
			break

print( cnt )

### FIXED CODE ###

n = int( input( ) )
t = [ int( val ) for val in input( ).rstrip( ).split( " " ) ]
q = int( input( ) )
s = [ int( val ) for val in input( ).split( " " ) ]
 
cnt = 0
for si in s:
    for ti in t:
        if si == ti:
            cnt += 1
            break
 
print( cnt )
#python D-Partition.py
"""
入力フォーマット
N M

出力:a_1+...+a_N=Mを満たす数列aについてmax(GCD(a_1,...,a_N))
"""
import math
line = list(map(int, input().split(" ")))
N = int(line[0])
M = int(line[1])

#TLE(実行時間制限超過)のコード
"""
for i in range(math.floor(M/N),0,-1):
	tmp = M-i*(N-1)
	if tmp%i==0:
		print(i)
		break
"""

#TLEを何とかしたコード（ポイント：素数判定と同じ要領で探索範囲をO(sqrt(M))にした
for i in range(sqrt(M)):
	tmp = M-(math.floor(M/N)-i)*(N-1)
	if tmp%(math.floor(M/N)-i)==0:
		print((math.floor(M/N)-i))
		break


### FIXED CODE ###

from math import sqrt

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

divisor = set([])
for i in range(1,int(sqrt(M))+1):
	if M % i == 0:
		if i <= int(M / N):
			divisor.add(i)
		if (M // i) <= int(M / N):
			divisor.add(M // i)

print(max(divisor))
h, w = map(int,input().split())
c = [list(map(int,input().split())) for i in range(10)]
a = [list(map(int,input().split())) for i in range(h)]

'''重み0の辺は自動で消されてしまうので注意'''
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
inf = 10 ** 10
G = csgraph_from_dense(c, null_value = 10 ** 10)
d = floyd_warshall(G)
cost = 0

for i in range(h):
    for j in range(w):
        temp = a[i][j]
        if temp == -1:continue
        cost += d[temp][1]
print(int(cost))

### FIXED CODE ###

h, w = map(int,input().split())
c = [list(map(int,input().split())) for i in range(10)]
a = [list(map(int,input().split())) for i in range(h)]

for k in range(10):
    for i in range(10):
        for j in range(10):
            if i == j:continue
            c[i][j] = min(c[i][j], c[i][k] + c[k][j])

cost = 0
for i in range(h):
    for j in range(w):
        temp = a[i][j]
        if temp == -1:continue
        cost += c[temp][1]
print(cost)
fin=open('in','r')
input=lambda:fin.readline().strip()

p=int(input())
fact=[0]*p
inv=[0]*p
def f(x):
	m=p-2
	ans=1
	while m:
		if m&1:ans=ans*x%p
		x=x*x%p
		m>>=1
	return ans
fact[0]=inv[0]=1
for i in range(1,p):
	fact[i]=fact[i-1]*i%p
	inv[i]=inv[i-1]*f(i)%p
r=list(map(int,input().split()))
c=[i+1 for i in range(p) if r[i] == 1]
#sum of -((x-j)^(p-1)-1)
coeff=[0]*p
for j in c:
	for i in range(p-1,-1,-1):
		if i&1:coeff[i]-=fact[p-1]*inv[i]*inv[p-1-i]*j**i
		else:coeff[i]+=fact[p-1]*inv[i]*inv[p-1-i]*j**i
	coeff[0]-=1
coeff=[((-t)%p+p)%p for t in coeff]
print(*coeff)

### FIXED CODE ###

#fin=open('in','r')
#input=lambda:fin.readline().strip()

p=int(input())
fact=[0]*p
inv=[0]*p
def f(x,m=p-2):
	ans=1
	while m:
		if m&1:ans=ans*x%p
		x=x*x%p
		m>>=1
	return ans
fact[0]=inv[0]=1
for i in range(1,p):
	fact[i]=fact[i-1]*i%p
	inv[i]=inv[i-1]*f(i)%p
r=list(map(int,input().split()))
c=[i for i in range(p) if r[i] == 1]
#sum of -((x-j)^(p-1)-1)
# (-j + x)^(p-1) = sum((-j)^i * x^(p-1-i) * binom(p-1,i))
coeff=[0]*p
for j in c:
	for i in range(p-1,-1,-1):
		if i&1:coeff[p-1-i]+=fact[p-1]*inv[i]*inv[p-1-i]*f(j,i)%p
		else:coeff[p-1-i]-=fact[p-1]*inv[i]*inv[p-1-i]*f(j,i)%p
	coeff[0]+=1
coeff=[(t%p+p)%p for t in coeff]
print(*coeff)
import sys

input = sys.stdin.readline

n_k = list(map(int, input().split()))
n = n_k[0]
k = n_k[1]
a = list(map(int, input().split()))
a_pos = list(filter(lambda v: v > 0, a))
a_neg = list(filter(lambda v: v < 0, a))

a_pos.sort(reverse=True)
a_neg.sort()

ans = 1
if len(a_pos) == 0 and k % 2 == 1:
    for i in reversed(range(len(a_neg) - k, len(a_neg))):
        ans = ans * a_neg[i] % 100000007
else:
    i_p = 0
    i_n = 0
    i = 0
    while i < k:
        if i == k - 1 or i_n+1 >= len(a_neg) or a_pos[i_p] * a_pos[i_p+1] > a_neg[i_n] * a_neg[i_n+1]:
            ans = ans * a_pos[i_p] % 1000000007
            i_p += 1
            i += 1
        else:
            ans = ans * a_neg[i_n] % 1000000007 * a_neg[i_n+1] % 1000000007
            i_n += 2
            i += 2
print(ans)


### FIXED CODE ###

import sys

input = sys.stdin.readline

n_k = list(map(int, input().split()))
n = n_k[0]
k = n_k[1]
a = list(map(int, input().split()))
a_pos = list(filter(lambda v: v >= 0, a))
a_neg = list(filter(lambda v: v < 0, a))

a_pos.sort(reverse=True)
a_neg.sort()

mod = 10**9+7

ans = 1
if n == k:
    for a_i in a:
        ans = ans * a_i % mod
elif len(a_pos) == 0 and k % 2 == 1:
    for i in reversed(range(len(a_neg) - k, len(a_neg))):
        ans = ans * a_neg[i] % mod
else:
    i_p = 0
    i_n = 0
    i = 0
    while i < k:
        if i_p < len(a_pos) and (i == k - 1 or i_n+1 >= len(a_neg) or a_pos[i_p] * (a_pos[i_p+1] if i_p+1 < len(a_pos) else 1) > a_neg[i_n] * a_neg[i_n+1]):
            ans = ans * a_pos[i_p] % mod
            i_p += 1
            i += 1
        else:
            ans = ans * a_neg[i_n] % mod * a_neg[i_n+1] % mod
            i_n += 2
            i += 2
print(ans)
inp = map(int, input().split())
inp = inp.list()
hard = 0
for number in range(0, 3) :
  if inp[number] == inp[number + 1] :
    print ("Bad")
    hard = 1
    
if hard == 0 :
  print ("Good")

### FIXED CODE ###

inp = list(input())
hard = 0
for number in range(0, 3) :
  if inp[number] == inp[number + 1] :
    hard = 1
    
if hard == 0 :
  print("Good")
else :
  print("Bad")
N, K = map(int, input().split())
div = N // K
if K % 2 == 1:
    print(div**3)
else:
    if div * N + K // 2 <= N:
        print(div**3 + (div + 1)**3)
    else:
        print(2 * div**3)

### FIXED CODE ###

N = int(input())
if N % 2 == 0:
    answer = (N // 2)**2
else:
    answer = (N // 2) * (N // 2 + 1) 

print(answer)
a = input()
 
if b(i == "A" for i in a) or b(i == "B" for i in a):
    print("No")
else:
    print("Yes")

### FIXED CODE ###

a = str(input())
if a == 'AAA' or a == 'BBB':
    print('No')
else:
    print('Yes')
L = int(input())
x = float(L/3)
print(x**3)

### FIXED CODE ###

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

def cmb(n,r):
    if r > n:
        return 0
    if r == 0 or r == n:
        return 1
    if r == 1:
        return n
    return cmb(n-1,r) + cmb(n-1,r-1)

ret = cmb(N,2) + cmb(M,2)
print(ret)
n,q=map(int,input().split())
ki=[[] for i in range(n+1)]
ki[0]="null"

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

scores=[0 for i in range(n+1)]
scores[0]="null"
for i in range(q):
    p,x=map(int,input().split())
    scores[p]+=x


ans=[0 for i in range(n+1)]
ans[0]="null"
point=0


def tansa(n,point):
    point+=scores[n]
    for p in ki[n]:
        tansa(p,point)
    else:
        ans[n]=point
        
tansa(1,0)

ans=ans[1:]
ans=[str(i) for i in ans]
print(" ".join(ans))

### FIXED CODE ###

n,q=map(int,input().split())
L=[[] for i in range(n+1)]
S=[0 for i in range(n+1)]
V=[0 for i in range(n+1)]

for _ in range(n-1):
    a,b=map(int,input().split())
    L[a].append(b)   
    L[b].append(a)

for _ in range(q):
    p,x=map(int,input().split())
    S[p]+=x


que=[1]
head=0
V[1]=1
while len(que)>head:
    now=que[head]
    head+=1
    for nex in L[now]:
        if V[nex]==0:
            V[nex]=1
            que.append(nex)
            S[nex]+=S[now]

print(" ".join([str(i) for i in S[1:]]))
def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

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())
F=primes(max(A,B)//2)
C=divisor(A)
C.sort()
D=divisor(B)
D.sort()
a=0
b=0

E=list(set(C)&set(D))
G=list(set(E)&set(F))
print(len(G)+1)

### FIXED CODE ###

def prime_decomposition(n): #素因数分解でリストを返す
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

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

C=prime_decomposition(A)
D=prime_decomposition(B)
E=list(set(C)&set(D))
print(len(E)+1)
src = int(input())
if src % 2 == 0:
    print('Odd')
else:
    print('Even')


### FIXED CODE ###

src = input()
vals = src.split(' ')
if int(vals[0]) * int(vals[1]) % 2 == 0:
    print('Even')
else:
    print('Odd')
x=input('AからBの運賃')
y=input('BからCの運賃')
int_x=int(x)
int_y=int(y)
a=(int_x+int_y)/2
print(a)


### FIXED CODE ###

s=input().split()
x=int(s[0])
y=int(s[1])
a=x+y/2
print(int(a))
x=int(input(x))
x=x**3
print(x)

### FIXED CODE ###

x=int(input())
x=x**3
print(x)
def main():
    n, *A = map(int, f.read().split())
    A.sort()
    n = A[-1]
    isPrime = [True] * (n + 1)
    prep = 0
    for i in A:
        if prep == i:
            isPrime[prep] = False
            continue
        if isPrime[i]:
            for j in range(i * 2, n + 1, i):
                isPrime[j] = False
        prep = i

    prep = res = 0
    for i in A:
        if prep == i:
            continue
        if isPrime[i]:
            res += 1
        prep = i
    print(res)


if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import defaultdict, Counter

def main():
  n, *A = map(int, open(0).read().split())
  A.sort()
  n = A[-1]
  isPrime = [True] * (n + 1)
  prep = 0
  for i in A:
    if prep == i:
      isPrime[prep] = False
      continue
    if isPrime[i]:
      for j in range(i * 2, n + 1, i):
        isPrime[j] = False
    prep = i

  prep = res = 0
  for i in A:
    if prep == i:
      continue
    if isPrime[i]:
      res += 1
    prep = i
  print(res)
if __name__ == '__main__':
  main()
import statistics
while True:
    x = input()
    if x == 0:
        break
    else:
        ls = list(map(int, input().split()))
        print(statistics.pstdev(ls))

### FIXED CODE ###

import statistics
while True:
    x = int(input())
    if x == 0:
        break
    else:
        ls = list(map(int, input().split()))
        print("{0:.8f}".format(statistics.pstdev(ls)))
# input
N = int(input())
A = [list(map(int, input().split())) for i in range(2)]

# check
element = set(A[0] + A[1])
if len(element) == 1:
    print(element + (N + 1))
else:
    end_x, end_y = 1, N - 1
    x, y = 0, 0
    res = A[0][0]
    while (x, y) != (end_x, end_y):
        if x == end_x:
            y += 1
        elif y == end_y:
            x += 1
        else:
            next_right, next_down = sum(A[x][y + 1:]), sum(A[x + 1][y:])
            if next_down <= next_right:
                y += 1
            else:
                x += 1
        res += A[x][y]
    else:
        print(res)


### FIXED CODE ###

# input
N = int(input())
A = [list(map(int, input().split())) for i in range(2)]

# check
element = set(A[0] + A[1])
if len(element) == 1:
    print(list(element)[0] * (N + 1))
else:
    res = 0
    for d in range(N):
        if d == 0:
            sum_num = A[0][0] + sum(A[1])
        elif d == N - 1:
            sum_num = sum(A[0]) + A[1][N - 1]
        else:
            sum_num = sum(A[0][:d + 1]) + sum(A[1][d:])
        if res < sum_num:
            res = sum_num
    print(res)
s = input()
atcg = ["A", "T", "C", "G"]

max = 0
for i in range(len(s)-1):
  j = i
  while s[j] in atcg:
    if max <= j - i + 1:
      max = j - i + 1
    j += 1
      
print(max)

### FIXED CODE ###

def change(c):
  if c in atcg:
    return "1"
  else:
    return "0"
  
s = input()
atcg = "ATCG"
s = "".join([change(i) for i in s])
print(max([len(i) for i in s.split("0")]))
S = int(input))
h = S // 3600
m = S % 3600 /60
s = S % 60

print(h,m,s, sep=":"

### FIXED CODE ###

S = int(input())
h = S // 3600
m = S % 3600 // 60
s = S % 60 
print(h, m, s, sep=':')
d=int(input())
if d=25:
    print("Christmas")
elif d=24:
    print("Christmas Eve")
elif d=23:
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")


### FIXED CODE ###

d=int(input())
if d==25:
    print("Christmas")
elif d==24:
    print("Christmas Eve")
elif d==23:
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")
#int(input())
#map(int,input().split())
#list(map(int,input().split()))

a,b,n=map(int,input().split())
l=[]
if n>=b:
    x=b-1
else:
    x=n
print(math.floor((a*x)/b)-a*math.floor(x/b))

### FIXED CODE ###

#int(input())
#map(int,input().split())
#list(map(int,input().split()))
import math
a,b,n=map(int,input().split())
l=[]
if n>=b:
    x=b-1
else:
    x=n
print(math.floor((a*x)/b)-a*math.floor(x/b))
n = (input()
a = []
for i in range(n):
     a.append(input())
 
for j in range(n):
     a.append(input())

max = a[j]-a[i]
 while i < n:
    while  j < n:
       if max < a[j]-a[i]:
          max = a[j]-a[i]
        j+ = 1
     i+ = 1
  print  max

### FIXED CODE ###

N = int(raw_input())
min = int(raw_input())
max = int(raw_input())

ans = max - min
if max < min:
    min = max
 
for i in range(N - 2):
    R = int(raw_input())
    if R - min > ans:
        ans = R - min
    if R < min:
        min = R
 
print ans
n = int(input())
v = list(map(int, input().split()))

if len(set(v)) == 1:
    print(n // 2)
else:
    cnt_even = [0] * 10 ** 5
    cnt_odd = [0] * 10 ** 5
    max_even = 0
    max_odd = 0
    for i in range(n):
        if i % 2 == 0:
            cnt_even[v[i]] += 1
            if cnt_even[v[i]] > cnt_even[max_even]:
                max_even = v[i]
        else:
            cnt_odd[v[i]] += 1
            if cnt_odd[v[i]] > cnt_even[max_odd]:
                max_odd = v[i]
    print(n - cnt_even[max_even] - cnt_odd[max_odd])

### FIXED CODE ###

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

if len(set(v)) == 1:
    print(n // 2)
else:
    cnt_even = [[0, i] for i in range(10 ** 5 + 1)]
    cnt_odd = [[0, i] for i in range(10 ** 5 + 1)]
    for i in range(n):
        if i % 2 == 0:
            cnt_even[v[i]][0] += 1
        else:
            cnt_odd[v[i]][0] += 1

    cnt_even.sort()
    cnt_odd.sort()

    if cnt_even[-1][1] == cnt_odd[-1][1]:
        print(n - max(cnt_even[-1][0] + cnt_odd[-2][0], cnt_even[-2][0] + cnt_odd[-1][0]))
    else:
        print(n - cnt_even[-1][0] - cnt_odd[-1][0])