Harryxun/stf_run huggingface dataset:
def laod_to_mill():
    days = int(input())
    prices = tuple(map(int, input().split()))

    if max(prices) == prices[0]:
        print(1000)
        return

    total = 1000
    ks = 0

    for d in range(days):
        if d == days - 1:
            total += ks * prices[d]
            break

        if prices[d] < prices[d + 1]:
            buy = total // prices[d]
            total -= buy * prices[d]
            ks += buy

        elif prices[d] > prices[d + 1]:
            total += ks * prices[d]
            ks = 0

    print(total)


def main():
    laod_to_mill()


if __name__ == '__main__':
    main()


### FIXED CODE ###

def Kyu_in_atcoder():
    score = int(input())
    if score >= 1800:
        print(1)
    elif score >= 1600:
        print(2)
    elif score >= 1400:
        print(3)
    elif score >= 1200:
        print(4)
    elif score >= 1000:
        print(5)
    elif score >= 800:
        print(6)
    elif score >= 600:
        print(7)
    elif score >= 400:
        print(8)


def main():
	Kyu_in_atcoder()


if __name__ == '__main__':
    main()
# C - Snack
# https://atcoder.jp/contests/abc148/tasks/abc148_c

import math

# 最小公倍数を求める問題
A,B = map(int,input().split())

print(A * B // math.gcd(A, B))

### FIXED CODE ###

# C - Snack
# https://atcoder.jp/contests/abc148/tasks/abc148_c

import fractions

# 最小公倍数を求める問題
A,B = map(int,input().split())

print((A * B) // fractions.gcd(A, B))
from scipy.special import cmb

# 入力データのinput
N, K = map(int, input().split())

r_cnt = N - K
b_cnt = K

# 1. 赤ボールを並べる
# 2. 青ボールを置く位置のパターン数を求める
#    置ける場所は赤ボールの両端とボールの間

# 3. 青ボールの個数をどのように分けるかのパターン数を求める
#    青ボールの個数を分ける線の数を求める

for i in range(1, K+1):
    print(( cmb( r_cnt+1, i, exact = True ) * cmb( b_cnt-1, i-1, exact = True )) % (10**9+7))

### FIXED CODE ###

from operator import mul
from functools import reduce
def cmb(n, r):
    if r > n:
        return 0
    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

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

r_cnt = N - K
b_cnt = K

for i in range(1, K+1):
    print(( cmb( r_cnt+1, i ) * cmb( b_cnt-1, i-1 )) % (10**9+7))
mod=10**9+7
n,k=map(int,input().split())
l=sorted(list(map(int,input().split())))
ans=0

ll=1
ans+=ll*l[k-1]%mod
ml=1
for i in range(k,n):
  ll=ll*i//(i-k+1)
  ans+=l[i]*ll%mod
  ml*=(i/(i-k+1))
ml//=1

ans-=ml*l[0]
ans%=mod
for i in range(1,n-k+1):
  ml=ml*(n-i-k+1)//(n-i)
  ans-=ml*l[i]%mod

print(int(ans%mod))


### FIXED CODE ###

n,k=map(int,input().split())
l=sorted(list(map(int,input().split())))
mod=10**9+7
fact=[1]*(n+1)
inv=[1]*(n+1)
for i in range(2,n+1):
    fact[i]=i*fact[i-1]%mod
inv[-1]=pow(fact[-1],mod-2,mod)
for i in range(n,1,-1):
    inv[i-1]=inv[i]*i%mod
ans=0
for i in range(n):
    if i>=k-1:
        ans+=l[i]*fact[i]*inv[k-1]*inv[i-k+1]%mod
    if n-i-1>=k-1:
        ans-=l[i]*fact[n-i-1]*inv[k-1]*inv[n-i-1-k+1]%mod
    ans%=mod
print(ans)
S = input()
if S = 'ABC':
  print('ARC')
else:
  print('ABC')

### FIXED CODE ###

S = input()

if S == 'ABC':
  print('ARC')
else:
  print('ABC')
n=int(input())
a=list(map(int,input().split()))

mod=1000000007
ans=1
r,b,g=0,0,0
for i in a:
    if r2==r and b2==b and g2==g:
        print(0)
        exit()
    if i==r and i==b and i==g:
        ans*=3
        ans%=mod
        r+=1
    elif (i==r and i==b) or (i==g and i==r):
        ans*=2
        ans%=mod
        r+=1
    elif i==b and i==g:
        ans*=2
        ans%=mod
        g+=1
    elif i==r:
        r+=1
    elif i==b:
        b+=1
    elif i==g:
        g+=1

    else:
        print(0)
        exit()
print(ans)

### FIXED CODE ###

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

mod=1000000007
ans=1
r,b,g=0,0,0
r2,b2,g2=-1,-1,-1
for i in a:
    if r2==r and b2==b and g2==g:
        print(0)
        exit()
    r2=r
    b2=b
    g2=g
    if i==r and i==b and i==g:
        ans*=3
        ans%=mod
        r+=1
    elif (i==r and i==b) or (i==g and i==r):
        ans*=2
        ans%=mod
        r+=1
    elif i==b and i==g:
        ans*=2
        ans%=mod
        g+=1
    elif i==r:
        r+=1
    elif i==b:
        b+=1
    elif i==g:
        g+=1

    else:
        print(0)
        exit()

print(ans)
n, g = map(int, input().split())
cards = [[int(x) for x in input().split()] for _ in range(g)]

cards.sort(key=lambda x: x[0])
lmx = cards[g - 1][0]
cards.sort(key=lambda x: x[1])
rmn = min(cards[0][1], n)

print(max(0, rmn - lmx + 1))


### FIXED CODE ###

A, B = [int(x) for x in input().split()]
if A <= 5:
    print(0)
elif A <= 12:
    print(int(B / 2))
else:
    print(B)
num = list(map(int,input().split()))
    a = num[0]
    b = num[1]
    output = str(a)
    
    if a<b:
        output=output+" < ";
    elif a>b:
        output=output+" > ";
    else:
        output=output+" = ";

    print(output+str(b))

### FIXED CODE ###

a,b=map(int,input().split())
s=""
if a>b:
    s=">"
elif a<b:
    s="<"
else:
    s="=="
print("a",s,"b")
def d_WideFlip(S):
    import re
    from collections import Counter

    d = Counter(S)
    zero = d['0']
    one_continue = re.findall(r'1+', S)
    one_continue = len(max(one_continue))
    return max(zero, one_continue)

S = input()
print(d_WideFlip(S))

### FIXED CODE ###

def d_WideFlip(S):
    n = len(S)
    T = []  # 解説pdfにおけるT(S)の定義と同じもの
    for k in range(n - 1):
        if S[k] != S[k + 1]:
            T.append(max(k + 1, n - (k + 1)))  # 設問の文字列は1-indexedのため
    if len(T) > 0:
        return min(T)
    else:
        return n  # Sは0のみまたは1のみで構成されていた

S = input()
print(d_WideFlip(S))
N = int(input())
a = list(map(int, input().split()))
cnt=0
for i in range(len(a)):
    if i+1 < N:
        if a[i] == i+1:
            inter=a[i]
            a[i]=a[i+1]
            a[i+1]=inter
            cnt +=1
        continue
print(cnt)

### FIXED CODE ###

x,t=map(int, input().split())

print(max(x-t,0))
N,K,S = map(int, input().split())

sa = N-K+1
a = [1 for i in range(N)]

if K == 0:
    if S == 10**9:
        for i in range(N):
            a[i] = 10**9-1
    else:
        for i in range(N):
            a[i] == 10**9
    for x in a:
        print(a, end=" ")
elif S-sa+1 >0:
        
    a[0] = S - sa + 1

    for i in range(1,sa):
        a[i] = 1
    j = 0
    for i in range(sa,N):
        a[i] = a[j]

        j +=1
        j %= sa

    for x in a:
        print(x, end = " ")


else:
    for i in range(K):
        a[i] = S
    if S != 10**9:    
        for i in range(K,N):
            a[i] = 10**9
    else:
        for i in range(K,N):
            a[i] == 10**9 -1
    for x in a:
        print(x, end = " ")

### FIXED CODE ###

N,K,S = map(int, input().split())

sa = N-K+1
a = [1 for i in range(N)]
if S-sa+1 >0:
        
    a[0] = S - sa + 1

    for i in range(1,sa):
        if i < N:
    
            a[i] = 1
    j = 0
    for i in range(sa,N):
        a[i] = a[j]

        j +=1
        j %= sa

    for x in a:
        print(x, end = " ")


else:
    for i in range(K):
        a[i] = S
    if S != 10**9:    
        for i in range(K,N):
            a[i] = 10**9
    else:
        for i in range(K,N):
            a[i] == 10**9 -1
    for x in a:
        print(x, end = " ")
try:c,d=int(input().split())
except:d=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
e=0;i=0
while i<d-e:
    p=i;q=0
    for j in range(c):
        if a[j]==b[p]:q+=1;p+=1
    e=max(e,q)
    i+=1
print(e)

### FIXED CODE ###

s=list(map(int,input().split()))
if len(s)>1:c=s[0];d=s[1]
else:c=s[0];d=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
e=0;i=0
while i<d-e:
    p=i;q=0
    for j in range(c):
        if a[j]==b[p]:q+=1;p+=1
    e=max(e,q)
    i+=1
print(e)
n = int(input())
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))

    cnt = 0
    res = 0 #余力
    for i in range(n):

        ch = min(a[i],res)
        cnt += ch
        a[i] -= ch
        if b[i] > a[i]:
            cnt += a[i]
            res = b[i] - a[i]
        else:
            cnt += b[i]
            res = 0
    
    cnt += min(a[n],res)

    print(cnt)

### FIXED CODE ###

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

cnt = 0
res = 0 #余力
for i in range(n):

    ch = min(a[i],res)
    cnt += ch
    a[i] -= ch
    if b[i] > a[i]:
        cnt += a[i]
        res = b[i] - a[i]
    else:
        cnt += b[i]
        res = 0

cnt += min(a[n],res)

print(cnt)
import sys
import collections as cc
import math as mt
I=lambda:list(map(int,input().split()))
a,b,c,d=I()
print(max(a*c,a*d,b*d,b*d))

### FIXED CODE ###

import sys
import collections as cc
import math as mt
I=lambda:list(map(int,input().split()))
n,=I()
if n==1:
	print(0)
else:
	print(1)
from operator import mul
from functools import reduce

def cmb(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

N, K = map(int, input().split())
cmb_val = cmb(N-1,2)
ma = (N-1)*(N-2)/2

if ma <= K:
  print('-1')
else:
  a =[(1, i) for i in range(2, N+1)]
  b = [(i, j) for i in range(2, N+1) for j in range(i+1, N+1)]
  a.extend(b[:cmb_val-K])
      
  print(len(a))
  for i in range(len(a)):
    print(a[i][0], a[i][1])
  
  

### FIXED CODE ###

from operator import mul
from functools import reduce

def cmb(n,r):
  if n < r:
    return 0
  else:
    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

N, K = map(int, input().split())
ma = (N-1)*(N-2)/2

if ma < K:
  print('-1')
else:
  cmb_val = cmb(N-1,2)
  a =[(1, i) for i in range(2, N+1)]
  b = [(i, j) for i in range(2, N+1) for j in range(i+1, N+1)]
  a.extend(b[:cmb_val-K])
      
  print(len(a))
  for i in range(len(a)):
    print(a[i][0], a[i][1])
N = int(input())
arr = list(map(int, input().split()))
while len(arr)>1:
    arr=sorted(arr)
    v1 = arr.pop(0)
    v2 = arr.pop(0)
    arr.append((v1+v2)/2)
print(sum(arr))

### FIXED CODE ###

a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print('red')
n,m,x=map(int,input().split())
a=list(map(int,input().split()))
print(min(len([i for i in a if i<x]),len([j for j in a if i>x])))

### FIXED CODE ###

n,m,x=map(int,input().split())
a=list(map(int,input().split()))
print(min(len([i for i in a if i<x]),len([j for j in a if j>x])))
a,b=map(int,input().split())

c=a+b
if c<a-b :
  c=a-b
if c<ab :
  c=ab
print(c)

### FIXED CODE ###

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

c=a+b
if c<a-b :
  c=a-b
if c<a*b :
  c=a*b
print(c)
for a in Str:
    Codigo.append(a)

lenMax=len(Codigo)-1
k=0

while i < len(Codigo)-1:
    lenAnterior = len(Codigo)-1
    
    if Codigo[i] == "0" and Codigo[i+1]=="1":
        contador+=2
        Codigo.pop(i)
        Codigo.pop(i)
    elif Codigo[i] == "1" and Codigo[i+1]=="0":
        contador+=2
        Codigo.pop(i)
        Codigo.pop(i)
        
    if lenAnterior != len(Codigo)-1:
        i=i-1
    else:
        i=i+1

    k+=1

    if k >= lenMax:
        break
    
print(contador)

### FIXED CODE ###

def main(s):
    a = s.count("0")
    b = s.count("1")
    return 2*min(a,b)

s = input()


print(main(s))
import numpy as np

H, W, M = map(int, input().split())
map_ = np.zeros((H, W), dtype=np.uint8)

h_sum = [0] * H
w_sum = [0] * W


### FIXED CODE ###

# import numpy as np

H, W, M = map(int, input().split())
#map_ = np.zeros((H, W), dtype=np.bool)

h_sum = [0] * H
w_sum = [0] * W
point_list = set()

for _ in range(M):
    h, w = map(int, input().split())
    # map_[h-1, w-1] = 1
    point_list.add((h-1, w-1))
    h_sum[h-1] += 1
    w_sum[w-1] += 1

h_max = max(h_sum)
w_max = max(w_sum)

h_argmax = set()
w_argmax = set()

for i, h in enumerate(h_sum):
    if h == h_max:
        h_argmax.add(i) 

for i, w in enumerate(w_sum):
    if w == w_max:
        w_argmax.add(i)

ans = h_max + w_max

for h in h_argmax:
    for w in w_argmax:
        if (h, w) not in point_list:
        # if map_[h, w] == 0:
            print(ans)
            exit()
print(ans - 1)
from collections import*
n=int(input())
a=dict(Counter(list(map(int,input().split()))))
flag=1
if n%3:flag=0
elif len(a)==1 and a.key()[0]!=0:flag=0
elif len(a)==2 and a.get(0)!=n//3:flag=0
elif len(a)==3 and not(a.key()[0]==a.key()[1]==a.key()[2]==n//3):flag==0
print(['No','Yes'][flag])

### FIXED CODE ###

from collections import*
n=int(input())
a=list(map(int,input().split()))
ans=a[0]
for i in a[1:]:
  ans^=i
a=dict(Counter(a))
ak=list(a.keys())
if len(a)==1 and ak[0]!=0:ans=1
elif len(a)==2 and a.get(0)!=n//3:ans=1
elif len(a)==3 and not(a[ak[0]]==a[ak[1]]==a[ak[2]]==n//3):ans=1
elif len(a)>3:ans=1
print(['Yes','No'][ans>0])
import sys,io

ws = sys.stdin.readline().strip().split()
n = int(ws[0])
m = int(ws[1])
ls_a = []
ls_b = [[] for i in range(n)]
for i in range(M):
    p,y = map(int, sys.stdin.readline().strip().split())
    ls_a.append([p,y])
    ls_b[p-1].append(y)
for i in range(n):
    ls_b[i].sort()
for i in range(m):
    print(str(ls_a[i][0]).zfill(6) + str(ls_b[ls_a[i][0]-1].index(ls_a[i][1])+1).zfill(6))

### FIXED CODE ###

N,M=map(int,input().split())
PY=[list(map(int,input().split()))+[i] for i in range(M)] #定義終了
 
PY.sort(key= lambda x:x[1])
num=[0]*N
w=[""]*M
 
for p,y,i in PY:
	num[p-1]+=1
	w[i]=str(p).zfill(6)+str(num[p-1]).zfill(6)

for i in range(M):
  	print(w[i])
num = input()

print(int(num/2))

### FIXED CODE ###

num = input()
num = int(num)

page = int(num/2)

if num%2 != 0:
  page += 1

print(page)
n=map(int,input())
s=str(input())

count=0
for i in range(n-2):
    if s[i]=="A":
        if s[i+1]=="B":
            if s[i+2]=="C":
                count+=1

print(count)

### FIXED CODE ###

n=int(input())
s=str(input())

count=0
for i in range(n-2):
    if s[i]=="A":
        if s[i+1]=="B":
            if s[i+2]=="C":
                count+=1

print(count)
N, M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()

X_dif = []

excep = 0

if M == 1:
    excep = 'M1'
    
if not excep == 'M1':
    for i in range(M-1):
        X_dif.append(X[i+1]-X[i])
    
    X_dif.sort()
    X_dif.reverse()

    if len(X_dif) == 1:
        excep = 'X_dif1'
    
    if not excep == 'X_dif1':
        for N in range(N-1):
            X_dif.pop(0)

if excep == 'M1':
    print(1)
elif excep == 'X_dif1':
    print(2)
else:
    print(sum(X_dif))

### FIXED CODE ###

# print('input >>')
N, M = map(int,(input().split()))
X = list(map(int,(input().split())))
X.sort()
Xdiff = [X[i + 1] - X[i] for i in range(len(X) - 1)]
Xdiff.sort(reverse=True)
ans = (X[-1]-X[0]) - sum(Xdiff[:N-1])

# print('----------output----------')
print(ans)
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


a = inls()
b = inls()
c = inls()
print(a[0] + b[1] + c[2])

### FIXED CODE ###

import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


a = inps()
b = inps()
c = inps()
print(a[0] + b[1] + c[2])
A, B, C, D = map(int, input().split())
total = B - A + 1
num_C = B // C - (A-1)//C
num_D = B // D - (A-1)//D

from math import gcd
g = gcd(C, D)
l = C * D // g
num_CD = B//l - (A-1)//l
ans = total - (num_C + num_D - num_CD)
print(ans)


### FIXED CODE ###

A, B, C, D = map(int, input().split())
total = B - A + 1
num_C = B // C - (A-1)//C
num_D = B // D - (A-1)//D

from fractions import gcd
g = gcd(C, D)
l = C * D // g
num_CD = B//l - (A-1)//l
ans = total - (num_C + num_D - num_CD)
print(ans)
card=input().split()
k=int(input())
arr=[]
for i in range(len(card)):
    res=int(card[i])*2
    arr.append(res)
if arr[0]<arr[1]<arr[2]:
    print('Yes')
else:
    print('No')



### FIXED CODE ###

inp=int(input())
if 400<=inp<=599:
    print(8)
if 600<=inp<=799:
    print(7)
if 800<=inp<=999:
    print(6)
if 1000<=inp<=1199:
    print(5)
if 1200<=inp<=1399:
    print(4)
if 1400<=inp<=1599:
    print(3)
if 1600<=inp<=1799:
    print(2)
if 1800<=inp<=1999:
    print(1)
a, loop = input().split()
string = input()

for i in range(int(loop)):
  j, k = input().split()
  print(string[int(j)-1:int(k)].count('AC'))

### FIXED CODE ###

b = input().strip()
d = {"A": "T", "C": "G", "T": "A", "G": "C"}
print(d[b])
import math
N, D = map(int, input().split())
P = [list(map(int, input().split()) for _ in range(N))]

cnt = 0
for i in range(N):
    d = math.sqrt(P[0]**2 + P[1]**2)
    if d <= D:
        cnt += 1

print(cnt)

### FIXED CODE ###

import math
N, D = map(int, input().split())
P = [list(map(int,input().split())) for i in range(N)]

cnt = 0
for i in range(N):
    d = math.sqrt(int(P[i][0])**2 + int(P[i][1])**2)
    if d <= D:
        cnt += 1

print(cnt)
def plus(number_list):
    return sum([int(num) for num in number_list])


def minus(number_list):
    numbers = [int(num) for num in number_list]
    
    return numbers[0] - sum(numbers[1:])


def multiply(number_list):
    
    numbers = [int(num) for num in number_list]
    
    def recrusive(repeat_num, list_):
    
        if repeat_num == 0:
            return list_[0]
        else:
            return recrusive(repeat_num -1,list_)*list_[repeat_num]
    
    return [recrusive(i,number_list) for i in range(len(number_list))][-1]


def divide(number_list):
    
    numbers = [int(num) for num in number_list]
    
    def recrusive(repeat_num, list_):
    
        if repeat_num == 0:
            return list_[0]
        else:
            return recrusive(repeat_num -1,list_)/list_[repeat_num]
    
    return [recrusive(i,number_list) for i in range(len(number_list))][-1]



store_result = []
store_num = []

result = 0

for  i,c in enumerate(input_list.split()):
    
    
    
    if i < len(input_list.split())-1:

        
        if c == '+' :
            result = plus(store_num)
            store_num = []
            store_result.append(result)
        elif c== "-":
            result = minus(store_num)
            store_num = []
            store_result.append(result)
        elif c =='*':
            result = multiply(store_num)
            store_num = []
            store_result.append(result)     
        elif c == '/':
            result = divide(store_num)
            store_num = []
            store_result.append(result)
        else:
            store_num.append(int(c))
    
    
    
    else:
        if c == '+' :
            result = plus(store_result)
        elif c== "-":
            result = minus(store_result)
        elif c =='*':
            result = multiply(store_result)
        elif c == '/':
            result = divide(store_result)
        
print(result)
        
        


### FIXED CODE ###

stack = []
store_num = []
store_result = []

for i,c in enumerate(input().split()): 
        
        def pop_and_stack(list_,num):
                     
            list_.pop()
            list_.pop()
            list_.append(num)
            
            return list_
            
    
        if c == '+' :
            a = stack[-2]
            b = stack[-1]
            num = a+b
            pop_and_stack(stack,num)

        elif c== "-":
            a = stack[-2]
            b = stack[-1]
            num = a-b
            pop_and_stack(stack,num)
        elif c =='*':
            a = stack[-2]
            b = stack[-1]
            num = a*b
            pop_and_stack(stack,num)  
        elif c == '/':
            a = stack[-2]
            b = stack[-1]
            num = a/b
            pop_and_stack(stack,num)
        else:
            stack.append(int(c))
            
print(stack[-1])
#coding:utf-8
from copy import deepcopy
n = int(input())
A = []
for i in range(n):
    ch, num = input().split()
    A.append([ch, int(num)])

B = deepcopy(A)



def Merge(A, left, mid, right):
    L = A[left:mid]
    R = A[mid:right]
    L.append(["S",20000000])
    R.append(["S",20000000])
    i,j = 0,0
    for k in range(left,right):
        if L[i][1] <= R[j][1]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1

def MergeSort(A, left, right):
    if left+1 < right:
        mid = (left + right)//2
        MergeSort(A, left, mid)
        MergeSort(A, mid, right)
        Merge(A, left, mid, right)

    

def partition(A, p, r):
    x = A[r-1][1]
    i = p-1
    for j in range(p, r):
        if A[j][1] <= x:
            i += 1
            A[i], A[j] = A[j], A[i]
    return i


def quickSort(A, p, r):
    if p < r:
        q = partition(A, p, r)
        quickSort(A, p, q)
        quickSort(A, q+1, r)




        
quickSort(A, 0, n)
MergeSort(B, 0, n)

if A == B:
    print("Stable")
else:
    print("Not stable")
    
for a in A:
    a = " ".join([a[0],str(a[1])])
    print(a)


### FIXED CODE ###

#coding:utf-8
from copy import deepcopy
n = int(input())
A = []
for i in range(n):
    ch, num = input().split()
    A.append([ch, int(num)])

B = deepcopy(A)



def Merge(A, left, mid, right):
    L = A[left:mid]
    R = A[mid:right]
    L.append(["S",2000000000])
    R.append(["S",2000000000])
    i,j = 0,0
    for k in range(left,right):
        if L[i][1] <= R[j][1]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1

def MergeSort(A, left, right):
    if left+1 < right:
        mid = (left + right)//2
        MergeSort(A, left, mid)
        MergeSort(A, mid, right)
        Merge(A, left, mid, right)

    

def partition(A, p, r):
    x = A[r-1][1]
    i = p-1
    for j in range(p, r):
        if A[j][1] <= x:
            i += 1
            A[i], A[j] = A[j], A[i]
    return i


def quickSort(A, p, r):
    if p < r:
        q = partition(A, p, r)
        quickSort(A, p, q)
        quickSort(A, q+1, r)




        
quickSort(A, 0, n)
MergeSort(B, 0, n)

if A == B:
    print("Stable")
else:
    print("Not stable")
    
for a in A:
    a = " ".join([a[0],str(a[1])])
    print(a)
=int(input())
print(((N+1)//2)/N)



### FIXED CODE ###

N=int(input())
print(((N+1)//2)/N)