Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

#!/usr/bin/env python3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys,collections

N = int(sys.stdin.readline())
a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param

from math import gcd
import math
pairwise = True
setwise = True
acc = a[0]
for i in range(N):
    acc = math.gcd(acc,a[i])
if acc != 1:
    print("not coprime")
    exit()

def factrial(N):
    ret = []
    n = N
    for i in range(2,math.floor(pow(N,0.5))+1):
      while n%i==0:
        ret.append(i)
        n = n//i
    if n != 1:
        ret.append(n)
    return ret

# facts = [set(factrial(e)) for e in a]
s = set()
for e in a:
    f = set(factrial(e))
    if f & s:
        print("setwise coprime")
        exit()
    s = s | f
print("pairwise coprime")

### FIXED CODE ###

import math
from collections import defaultdict
pc = True
n = int(input())
a = list(map(int,input().split()))
g = math.gcd(a[0],a[1])
for i in range(2,n):
    g = math.gcd(g,a[i])
M = max(a)
class Sieve_of_Eratosthenes:
    def __init__(self, N):
        self.sieve = [-1] * (N+1)
 
        for i in range(2,N+1):
            if self.sieve[i] == -1:
                for j in range(1,1+N//i):
                    self.sieve[i*j] = i
 
    def isprime(self, num):
        if num <= 1:
            return False
        else:
            return self.sieve[num] == num
 
    def factorization(self, num):
        ret = set([])
        while num != 1:
            div = self.sieve[num]
            ret.add(div)
            num //= div
        return ret
 
sofe = Sieve_of_Eratosthenes(M)
ddic = defaultdict()
judge = set([])
 
for i in a:
    if not pc:
        break
    asf = sofe.factorization(i)
    
    if judge & asf != set():
        pc = False
    judge |= asf
if pc:
    print("pairwise coprime")
elif g == 1:
    print("setwise coprime")
else:
    print("not coprime")
### BUGGY CODE ###

x,*s=open(0)
h,w,k,*m=map(int,x.split())
for b in range(512):
 r=t=j=0;d=[0]*h
 while j<w:
  i=c=0
  while h-i:
   d[c]+=s[i][j]>'0';x=d[c]>k
   if(t<j)&x:r+=1;t=j;d=[0]*h;break
   r+=x*h*w;c+=b>>i&1;i+=1
  else:j+=1
 while b:r+=b&1;b>>=1
 m+=r,
print(min(m))

### FIXED CODE ###

x,*s=open(0)
h,w,k,*m=map(int,x.split())
for b in range(512):
 r=t=j=0;d=[0]*h
 while j<w:
  i=c=0
  while h-i:
   d[c]+=s[i][j]>'0';x=d[c]>k
   if(t<j)&x:r+=1;t=j;d=[0]*h;break
   r+=x*h*w;c+=b>>i&1;i+=1
  else:j+=1
 while b:r+=b&1;b>>=1
 m+=r,
print(min(m))
### BUGGY CODE ###

import fractions


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


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

# よい文字列が存在する場合、答えは最小公倍数となる
l = lcm(n, m)

# 連結するとSになるXの位置リストを生成
ss = [l // n * i for i in range(n)]
# 連結するとTになるXの位置リストを生成
tt = [l // m * i for i in range(m)]

# 条件を満たすか判定
for s_num in ss:
    if s_num in tt:
        s_idx = ss.index(s_num)
        t_idx = tt.index(s_num)
        if s[s_idx] != t[t_idx]:
            l = -1
            break
print(l)


### FIXED CODE ###

import fractions


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

# 先頭文字が一致しない場合はよい文字列は存在しないので終了
if s[0] != t[0]:
    print(-1)
    exit()

# よい文字列が存在する場合、答えは最小公倍数となる
l = (n * m) // fractions.gcd(n, m)

# 連結するとSになるXの位置リストを生成
ss = set(l // n * i for i in range(1, n))
# 連結するとTになるXの位置リストを生成
tt = set(l // m * i for i in range(1, m))

# 共通部分を取得
same = list(ss & tt)

# メモリ開放
del ss
del tt

a = [s[item // (l // n)] for item in same]
b = [t[item // (l // m)] for item in same]

print(l) if a == b else print(-1)
### BUGGY CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
ans=[float("inf")]*n
ans[0]=0
for i in range(1,n):
    if i-k<=0:
        tmp=float("inf")
        for j in range(i):
            tmp=min(tmp,ans[j]+abs(h[j]-h[i]))
        ans[i]=tmp
    else:
        tmp=float("inf")
        for j in range(i-k,i):
            tmp=min(tmp,ans[j]+abs(h[j]-h[i]))
        ans[i]=tmp
print(ans[n-1])

### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
ans=[float("inf")]*n
ans[0]=0
for i in range(1,n):
    if i-k<=0:
        tmp=float("inf")
        for j in range(i):
            tmp=min(tmp,ans[j]+abs(h[j]-h[i]))
        ans[i]=tmp
    else:
        tmp=float("inf")
        for j in range(i-k,i):
            tmp=min(tmp,ans[j]+abs(h[j]-h[i]))
        ans[i]=tmp
print(ans[n-1])
### BUGGY CODE ###

X = int(input())
# 100 * 21 = 105 * 20, が最大の可換性であり，基本的にはあり得る組み合わせは非常に少ない.それ以外は
# 100 * 26 = 104 * 25, 100 * 101 = 101 * 100,これとかはありえない,100*51 = 102 * 50,とかはありえる
#100000/100 = 1000せいぜい商品の合計は1000子である10^3ならば10^3 ６回ループ回してもOK10^18になるけど?
import sys

for a in range(1001): # aだけは1000の場合がありうるわ
    for b in range(1000):
        for c in range(1000):
            for d in range(1000):
                for e in range(1000):
                    for f in range(1000):
                        price = a*100 + b*101 + c*102 + d*103 + e*104 + f*105
                        rest = X-price
                        if rest >= 0:
                            if rest%100 == 0 or rest%101==0 or rest%102==0 or rest%103==0 or rest%104==0 or rest%105==0:
                                print(1)
                                sys.exit()

print(0)



### FIXED CODE ###

X = int(input())

# iがそんなに大きくないのでiについてループを回すことができる．dpiを"i円の買い物ができるなら，"Yes","No""とします．
# dp0を'Yes'とする．
# dpi-100~105が'True'ならばdpiは0．それ以外ならば'False'
DP = [True]
for i in range(X): 
    if i+1-105 >= 0:
        DP_n = DP[i+1-100] or DP[i+1-101] or DP[i+1-102] or DP[i+1-103] or DP[i+1-104] or DP[i+1-105] 
    elif i+1==100 or i+1==101 or i+1==102 or i+1==103 or i+1==104:
        DP_n = True
    else:
        DP_n = False
    DP.append(DP_n)
print(int(DP[X]))
### BUGGY CODE ###

S = input()
Q = int(input())
for i in range(Q):
  Query_i = list(map(str, input().split()))
  if Query_i[0]=='1':
    S = S[::-1]
  elif Query_i[0]=='2':
    if Query_i[1]=='1':
      S = Query_i[2] + S
    elif Query_i[1]=='2':
      S = S + Query_i[2]
print(S)

### FIXED CODE ###

from collections import deque

S = deque(input())
Q = int(input())
flip = False # False: left side is the head
for i in range(Q):
  Query_i = list(map(str, input().split()))
  if Query_i[0]=='1':
    flip = not flip
  elif Query_i[1] == '1' and not flip:
    S.appendleft(Query_i[2])
  elif Query_i[1] == '1' and flip:
    S.append(Query_i[2])
  elif Query_i[1] == '2' and not flip:
    S.append(Query_i[2])
  elif Query_i[1] == '2' and flip:
    S.appendleft(Query_i[2])
if flip:
  S.reverse()
print(''.join(S))
### BUGGY CODE ###

#d
n=int(input())
x=list(input())

def popcount(m):
    return bin(m).count("1")

intx = int( "0b"+"".join(x) ,0 )
popcount0 = popcount(intx)

jisho = ["yet"]*n
for i in range(n):
    if x[i]=="0":
        pop = popcount0+1
        intxi = intx+pow(2,n-i-1)
    else:
        x[i] = "0"
        pop = popcount0-1
        intxi = intx-pow(2,n-i-1)
        
    if intxi==0:
        print(0)
        continue
    else:
        c=0
        while intxi!=0:
            if c==0:
                intxi=intxi%pop
            else:
                if jisho[intxi]=="yet":
                    togo = intxi%popcount(intxi)
                    jisho[intxi]= togo
                    intxi = togo
                else:
                    intxi =jisho[intxi]
                
            #print(intxi)
            c+=1
        print(c)
        #print()
#        print("f(n)=",c)

### FIXED CODE ###

#d 
n=int(input())
x=input()

def popcount(m):
    return bin(m).count("1")

intx = int( "0b"+x ,0 )
popcount0 = x.count("1")

intx_mod_pp1 = intx %(popcount0+1)
if popcount0!=1:
    intx_mod_pm1 = intx %(popcount0-1)
    

jisho = ["yet"]*n
# pow2ip = .5
# pow2im = .5

for i in range(n):
    if x[i]=="1" and popcount0==1:
        print(0)
        continue
    
    pow2ip = pow(2,n-i-1,popcount0+1)
    if popcount0!=1:
        pow2im = pow(2,n-i-1,popcount0-1)

    if False:
        pass
    
    
    else:
        intxi=1
        c=0
        while intxi!=0:
            if c==0:
                if x[i]=="0":
                    pop = popcount0+1
                    intxi = (intx_mod_pp1 + pow2ip%pop )%pop
                else:
                    pop = popcount0-1
                    intxi = (intx_mod_pm1 - pow2im%pop )%pop        
            else:
                if jisho[intxi]=="yet":
                    togo = intxi%popcount(intxi)
                    jisho[intxi]= togo
                    intxi = togo
                else:
                    intxi =jisho[intxi]
                
            #print(intxi)
            c+=1
        print(c)
        #print()
    
#        print("f(n)=",c)
### BUGGY CODE ###

import math
from functools import reduce

def gcd (*numbers):
    return reduce(math.gcd,numbers)
k = int(input())
total = 0

for i in range(1,k+1):
    for j in range(1,k+1):
        for x in range(1,k+1):
            total += gcd(i,j,x)
print(total)

### FIXED CODE ###

import math

k = int(input())
ans = 0

for a in range(1,k+1):
    for b in range(1,k+1):
        ab = math.gcd(a,b)
        if ab == 1:
            ans += k

        else:
            for c in range(1,k+1):
                ans += math.gcd(ab,c)
print(ans)
### BUGGY CODE ###

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

res = []
for i in range(n):
  if i % 2 == 0:
    res = [a[i]] + res
  else:
    res = res + [a[i]]
if n % 2 == 0:
  print ' '.join(map(str, res[::-1]))
else:
  print ' '.join(map(str, res))

### FIXED CODE ###

from collections import deque
n = input()
a = map(int, raw_input().split())

res = deque()

for i in range(n):
  if i % 2 == 0:
    res.appendleft(a[i])
  else:
    res.append(a[i])
if n % 2 == 0:
  print ' '.join(map(str, reversed(res)))
else:
  print ' '.join(map(str, res))
### BUGGY CODE ###

from sys import stdin

def main():
    import numpy as np
    from scipy import linalg
    input = stdin.readline

    n = int(input())
    a = [[] for _ in range(n)]
    for i in range(n - 1):
        a[i] = [0] * i + [1, 1] + [0] * (n - i - 2)
    a[n - 1] = [1] + [0] * (n - 2) + [1]
    A = np.array(a)
    b = np.array(list(map(int, input().split())))
    LU = linalg.lu_factor(A)
    x = linalg.lu_solve(LU, b) * 2
    print(' '.join(map(str, map(int, x))))
main()

### FIXED CODE ###

from sys import stdin

def main():
    input = stdin.readline

    n = int(input())
    a = list(map(int, input().split()))
    ans = [0] * n
    for i in range(n):
        if i % 2 == 0:
            ans[0] += a[i]
        else:
            ans[0] -= a[i]
    for i in range(1, n):
        ans[i] = 2 * a[i - 1] - ans[i - 1]
    print(' '.join(map(str, ans)))
main()
### BUGGY CODE ###

def men(t):
    xmin = min(st + i * t for i, st in enumerate(mg[0]))
    xmax = max(st + i * t for i, st in enumerate(mg[1]))
    ymin = min(st + i * t for i, st in enumerate(ue[0]))
    ymax = max(st + i * t for i, st in enumerate(ue[1]))
    return (xmax - xmin) * (ymax - ymin)

n = int(input())
inf = 10**9
mg = [[inf, inf, inf], [-inf, -inf, -inf]]
ue = [[inf, inf, inf], [-inf, -inf, -inf]]
mg0=mg[0]
mg1=mg[1]
ue0=ue[0]
ue1=ue[1]
for _ in range(n):
    x, y, d = input().split()
    x = int(x)
    y = int(y)
    if d == "U":
        mv = 1
        uv = 2
    elif d == "D":
        mv = 1
        uv = 0
    elif d == "R":
        mv = 2
        uv = 1
    else:
        mv = 0
        uv = 1
    if x < mg0[mv]: mg0[mv] = x
    if x > mg1[mv]: mg1[mv] = x
    if y < ue0[uv]: ue0[uv] = y
    if y > ue1[uv]: ue1[uv] = y
L = 0
R = max(max(mg[1])-min(mg[0]),max(ue[1])-min(ue[0]))
while R - L > 10 ** -10:
    l = (2 * L + R) / 3
    r = (L + 2 * R) / 3
    if men(l) > men(r):
        L = l
    else:
        R = r
t = (R + L) / 2
print(men(t))


### FIXED CODE ###

def men(t):
    xmin = min(st + i * t for i, st in enumerate(mg[0]))
    xmax = max(st + i * t for i, st in enumerate(mg[1]))
    ymin = min(st + i * t for i, st in enumerate(ue[0]))
    ymax = max(st + i * t for i, st in enumerate(ue[1]))
    return (xmax - xmin) * (ymax - ymin)

n = int(input())
inf = 10**9
mg = [[inf, inf, inf], [-inf, -inf, -inf]]
ue = [[inf, inf, inf], [-inf, -inf, -inf]]
mg0=mg[0]
mg1=mg[1]
ue0=ue[0]
ue1=ue[1]
for _ in range(n):
    x, y, d = input().split()
    x = int(x)
    y = int(y)
    if d == "U":
        mv = 1
        uv = 2
    elif d == "D":
        mv = 1
        uv = 0
    elif d == "R":
        mv = 2
        uv = 1
    else:
        mv = 0
        uv = 1
    if x < mg0[mv]: mg0[mv] = x
    if x > mg1[mv]: mg1[mv] = x
    if y < ue0[uv]: ue0[uv] = y
    if y > ue1[uv]: ue1[uv] = y
t=set([0])
for lst in [mg0,mg1,ue0,ue1]:
    v0,v1,v2=lst
    for tk in [v0-v1,v1-v2,(v0-v2)/2]:
        if tk>=0:
            t.add(tk)
print(min(men(tk) for tk in t))
### BUGGY CODE ###

N, K = map(int, input().split())
H = list(map(int, input().split()))
dp = [1 << 62] * N
dp[0] = 0
for i in range(1, N):
    for j in range(i, min(i + K, N)):
        cost = abs(H[i - 1] - H[j])
        dp[j] = min(dp[j], dp[i - 1] + cost)
print(dp[-1])


### FIXED CODE ###

import sys

# import numpy as np


def main():
    f = sys.stdin.buffer
    N, K = map(int, f.readline().split())
    H = list(map(int, f.readline().split()))
    dp = [0] * N
    for i in range(1, N):
        dp[i] = min(
            dp[i - k - 1] + abs(H[i] - H[i - k - 1]) for k in range(K) if i - k - 1 >= 0
        )
    print(dp[-1])


if __name__ == "__main__":
    main()
### BUGGY CODE ###

N = int(input())
a = tuple(map(int, input().split()))

def main():
    l = [[0] * N for _ in range(N)]
    for i in range(N):
        for j in range(N):
            if i + j >= N:
                continue
            s = j
            e = j + i
            if len(a) % 2 != i % 2:
                if i == 0:
                    l[s][e] = a[s]
                elif i == 1:
                    l[s][e] = max(a[s:e+1]) - min(a[s:e+1])
                else:
                    l[s][e] = max(a[s] + l[s+1][e], a[e] + l[s][e-1])
            else:
                if i == 0:
                    l[s][e] -= a[s]
                elif i == 1:
                    l[s][e] = min(a[s:e+1]) - max(a[s:e+1])
                else:
                    l[s][e] = min(l[s+1][e] - a[s], l[s][e-1] - a[e])


    return l[0][-1]
print(main())


### FIXED CODE ###

N = int(input())
a = tuple(map(int, input().split()))

def main():
    l = [[0] * N for _ in range(N)]
    for i in range(N):
        for j in range(N):
            if i + j >= N:
                continue
            s = j
            e = j + i
            if len(a) % 2 != i % 2:
                if i == 0:
                    l[s][e] = a[s]
                elif i == 1:
                    l[s][e] = max(a[s:e+1]) - min(a[s:e+1])
                else:
                    l[s][e] = max(a[s] + l[s+1][e], a[e] + l[s][e-1])
            else:
                if i == 0:
                    l[s][e] -= a[s]
                elif i == 1:
                    l[s][e] = min(a[s:e+1]) - max(a[s:e+1])
                else:
                    l[s][e] = min(l[s+1][e] - a[s], l[s][e-1] - a[e])


    return l[0][-1]
print(main())
### BUGGY CODE ###

N, K =map(int, input().split())
hs = [10**6]*K + list(map(int, input().split()))
dp = [0]*(N+K+1)
for i in range(K+1, N+K):
    ans = dp[i-1]+abs(hs[i]-hs[i-1])
    for k in range(2, K+1):
        ans = min(ans, dp[i-k]+abs(hs[i]-hs[i-k]))
    dp[i] = ans
print(dp[N+K-1])

### FIXED CODE ###

N, K =map(int, input().split())
hs = [10**6]*K + list(map(int, input().split()))
dp = [0]*(N+K+1)
for i in range(K+1, N+K):
    ans = dp[i-1]+abs(hs[i]-hs[i-1])
    for k in range(2, K+1):
        ans = min(ans, dp[i-k]+abs(hs[i]-hs[i-k]))
    dp[i] = ans
print(dp[N+K-1])
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import numpy as np
from copy import deepcopy
s = input()
cnt = 0
mod_13_cnt = np.array([0]*13)
hatena = [0,1,2,3,4,5,6,7,8,9]
#定数部分を評価
s_teisu = int(s.replace("?","0")) %13
mod_13_cnt[s_teisu]+=1
fn = lambda x : x %(10**9+7)
for i,s_i in enumerate(s[::-1]):
     mod_13_cnt = np.array(list(map(fn,mod_13_cnt)))
     ph = np.array([0]*13)
     if s_i!="?":
         continue
     for j in hatena:
         add_v = j*10**i%13
         ph += np.roll(mod_13_cnt,add_v)
     mod_13_cnt = ph
print(mod_13_cnt[5]%(10**9+7))


### FIXED CODE ###

# -*- coding: utf-8 -*-
s = input()
s = s[::-1]
MOD = 10**9+7
mod13_map = [[i for i in range(13)]]
ma = mod13_map.append
for i in range(1,10**5):
    next_digit = list(map(lambda x:x*10%13,mod13_map[i-1]))
    ma(next_digit)

ret = [1] + [0] * 12 #13で割ってi余る数の合計
for i,v in enumerate(s):
    if v!="?":
        #mod13_map[i][v]だけ、右にシフト
        ret *= 2
        sft = mod13_map[i][int(v)]
        ret = ret[13-sft:26-sft]
    else:
        temp_ret = [0] * 13
        for j in range(10):
            #?がjの場合
            for k,l in enumerate(ret):
                temp_ret[(k+mod13_map[i][j])%13]+=l
        temp_ret = list(map(lambda x:x%MOD,temp_ret))
        ret = temp_ret
print(ret[5]%MOD)
### BUGGY CODE ###

N = int(input())
S = list(input())
ans = 0
 
for i in range(N):
    first_s = S[i]
    for j in range(i+1, N):
        if S[j] != first_s:
            second_s = S[j]
            for k in range(j+1, N):
                if k == 2*j-i:
                    if (S[k] != first_s) and (S[k] != second_s):
                        continue
                if (S[k] != first_s) and (S[k] != second_s):
                    ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
S = list(input())

r, g, b = 0, 0, 0
ans = 0
for i in range(N):
    if S[i] == 'R':
        r += 1
    elif S[i] == 'G':
        g += 1
    else:
        b += 1

ans += r*g*b

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

print(ans)
### BUGGY CODE ###

S = input()
Q = int(input())

hanten = 0

for q in range(Q):
    query = input()
    if query == "1":
        if hanten == 0:
            hanten = 1
        else:
            hanten = 0
    else:
        T,F,C = query.split()
        if F == "1":
            if hanten == 0:
                S = C+S
            else:
                S = S+C
        elif F =="2":
            if hanten == 0:
                S = S + C
            else:
                S = C + S
            
if hanten == 0:
    print(S)
else:
    print(S[::-1])


### FIXED CODE ###

Slist = list(input())
Q = int(input())

hanten = 0
mae = [] # 後で反転
ushiro = []

for q in range(Q):
    query = input()
    if query == "1":
        if hanten == 0:
            hanten = 1
        else:
            hanten = 0
    else:
        T,F,C = query.split()
        if F == "1":
            if hanten == 0:
                mae.append(C)
            else:
                ushiro.append(C)
        elif F =="2":
            if hanten == 0:
                ushiro.append(C)
            else:
                mae.append(C)
# print("hanten:",hanten,"mae:",mae,"ushiro:",ushiro)            
if hanten == 0:
    rmae = mae[::-1]
    goukei = rmae + Slist + ushiro
    print(''.join(goukei))
else:
    goukei =ushiro[::-1] + Slist[::-1] + mae
    print(''.join(goukei))
### BUGGY CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

n = INT()
l = 0
r = n - 1
print(l, flush=True)
ltmp = STR() #初期状態 偶数席
if ltmp == 'Vacant':
    exit()
print(r, flush=True)
rtmp = STR() #最終状態 奇数
if rtmp == 'Vacant':
    exit()
while l < r:
    c = (l + r) // 2
    print(c, flush=True)
    tmp = STR()
    if tmp == 'Vacant':
        exit()
    if c % 2 == l % 2:
        if tmp == ltmp:
            l = c + 1
        else:
            r = c - 1
    else:
        if tmp == ltmp:
            r = c - 1
        else:
            l = c + 1
print(r, flush=True)
tmp = STR()
if tmp == 'Vacant':
    exit()

### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

n = INT()
l = 0
r = n - 1
print(l, flush=True)
ltmp = STR()
if ltmp == 'Vacant':
    exit()
print(r, flush=True)
rtmp = STR()
if rtmp == 'Vacant':
    exit()
for i in range(2, 20):
    c = (l + r) // 2
    print(c, flush=True)
    tmp = STR()
    if tmp == 'Vacant':
        exit()
    if c % 2 == l % 2:
        if tmp == ltmp:
            l = c
            ltmp = tmp
        else:
            r = c
    else:
        if tmp == ltmp:
            r = c
        else:
            l = c
            ltmp = tmp
### BUGGY CODE ###

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

# input N
n = int(input())

# N!を求める
nk = 1
for i in range(2, n+1):
    nk *= i

# nkの約数の個数を求める
x = 0
for i in range(1, nk+1):
    if nk % i == 0:
        x += 1

# xを10^9 + 7で割った余りを出力
x2 = x % (pow(10, 9) + 7)
print(x2)


### FIXED CODE ###

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

# input N
n = int(input())
a = [0] * (n+1)

s = 1
for i in range(2, n+1):
    for j in range(2, i):
        if i % j == 0:
            break
    else:
        for k in range(2, n+1):
            while k >= i:
                if k % i == 0:
                    a[i] += 1
                    k /= i
                else:
                    break

for i in range(2, n+1):
    if a[i] != 0:
        a[i] += 1
        s *= a[i]

print(s % (pow(10, 9) + 7))
### BUGGY CODE ###

import sys
from itertools import product
input = sys.stdin.readline
N, M = map(int, input().split())
INF = 10 ** 12
dp = [INF] * (2**N)
dp[0] = 0
for i in range(M):
    a, b = map(int, input().split())
    C = list(map(int, input().split()))
    base = sum(2**(c-1) for c in C)
    for j in range(2**N):
        if any(not ((j >> (c-1)) & 1) for c in C):
            step = base - sum(2**(c-1) for c in C if ((j >> (c-1)) & 1))
            dp[j+step] = min(dp[j+step], dp[j]+a)

print(dp[-1] if dp[-1] < INF else -1)


### FIXED CODE ###

import sys
input = sys.stdin.readline
N, M = map(int, input().split())
INF = 10 ** 12
T = [2**i for i in range(N)]
dp = [INF] * (2**N)
dp[0] = 0
for i in range(M):
    a, b = map(int, input().split())
    C = list(map(int, input().split()))
    step = sum(T[c-1] for c in C)
    for j in range(2**N):
        dp[step|j] = min(dp[step|j], dp[j]+a)

print(dp[-1] if dp[-1] < INF else -1)
### BUGGY CODE ###

n = int(input())
a =list(map(int,input().split()))
 
[print(a.count(i)) for i in range(1,n+1)]

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
al = [0 for i in range(n)]

for i in a:
    al[i-1] += 1
for i in range(n):
    print(al[i])