Harryxun/stf_run huggingface dataset:
bingo = [[],[],[]]
 
for i in range(3):
  a, b, c = map(int,input().split())
  bingo[i].append(a)
  bingo[i].append(b)
  bingo[i].append(c)
  
N = int(input())

  
for i in range(N):
  S = int(input())
  for j in range(3):
    if S in bingo[j]:
      for k in range(3):
        if S == bingo[j][k]:
          bingo[j][k] = 'ok'
          
ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[i][j] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
  ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[j][i] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
  ANS = 0
 
if bingo[1][1] == 'ok':
  if bingo[0][0] == 'ok' and bingo[2][2] == 'ok':
    print("Yse")
  elif bingo[0][2] == 'ok' and bingo[2][0] == 'ok':
    print("Yse")
 
 
print("No")

### FIXED CODE ###

N = int(input())
print(int((N+1)/2))
for i, x in enumerate((input()).strip()):
    x = int(input())
    if x == '0':
        break
    print('case ' + str(i) + ': ' + x)

### FIXED CODE ###

import sys
for i, x in enumerate(sys.stdin):
    x = x.strip()
    if x == '0':
        break
    print('Case %d: %s'%(i+1, x))
import math
import collections
import copy
import sys

n = int(input())

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

sCheck = math.gcd(a[0],a[1])
if n == 2:
    if sCheck == 1:
        print("pairwise coprime")
    else:
        print("not coprime")
    sys.exit()
else:
    for i in range(2,n):
        sCheck = math.gcd(sCheck,a[i])


beforeQ = collections.deque([i for i in range(3,(10**6 + 1))])
D = dict()
p = 2
D[2] = 2
D[1] = 1

while p < math.sqrt(10**6):
    afterQ = collections.deque()
    while len(beforeQ) > 0:        
        k = beforeQ.popleft()
        if k % p != 0:
            afterQ.append(k)
        else:
            D[k] = p
    beforeQ = copy.copy(afterQ)
    p = beforeQ.popleft()
    D[p] = p
    
ansSet = set()
count = 0

for i in a:
    k = int(i)
    kSet = set()
    while k != 1:
        if D[k] in ansSet:
            if not(D[k] in kSet):
                count = 1
                break
        else:
            ansSet.add(D[k])
            kSet.add(D[k])
        k = int(k // D[k])

if count == 0:
    print("pairwise coprime")
elif sCheck == 1:
    print("setwise coprime")
else:
    print("not coprime")


### FIXED CODE ###

import math
import collections
import copy
import sys

n = int(input())

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

limit = 10 ** 6

sCheck = math.gcd(a[0],a[1])
if n == 2:
    if sCheck == 1:
        print("pairwise coprime")
    else:
        print("not coprime")
    sys.exit()
else:
    for i in range(2,n):
        sCheck = math.gcd(sCheck,a[i])


beforeQ = collections.deque([int(i) for i in range(3,(limit + 1))])
D = dict()
p = 2
D[2] = 2
D[1] = 1

while p < math.sqrt(limit):
    afterQ = collections.deque()
    while len(beforeQ) > 0:        
        k = beforeQ.popleft()
        if k % p != 0:
            afterQ.append(k)
        else:
            D[k] = p
    beforeQ = copy.copy(afterQ)
    p = beforeQ.popleft()
    D[p] = p
while len(beforeQ) > 0:
    k = beforeQ.popleft()
    D[k] = k
    
ansSet = set()
count = 0

for i in a:
    k = i
    kSet = set()
    while k != 1:
        if D[k] in ansSet:
            if not(D[k] in kSet):
                count = 1
                break
        else:
            ansSet.add(D[k])
            kSet.add(D[k])
        k = int(k // D[k])
    if count == 1:
        break

if count == 0:
    print("pairwise coprime")
elif sCheck == 1:
    print("setwise coprime")
else:
    print("not coprime")
N = int(input())
l = len(N)
if l == 1:
  print(N)
elif l == 2:
  print(9)
elif l == 3:
  print(N-90)
elif l == 4:
  print(909)
elif l == 5:
  print(N-9090)
else:
  print(90909)

### FIXED CODE ###

N = input()
n = int(N)
l = len(N)

if l == 1:
  print(n)
elif l == 2:
  print(9)
elif l == 3:
  print(n-90)
elif l == 4:
  print(909)
elif l == 5:
  print(n-9090)
else:
  print(90909)
s = input()
K = int(input())

ans = ''
for i in range(len(s)):
    if K >= ord('z')-ord(s[i])+1:
        K -= ord('z')-ord(s[i])+1
        ans += 'a'
    else:
        ans += s[i]

if K >= 1:
    ans = ans[:-1]+chr(ord(ans[-1])+K)

print(ans)


### FIXED CODE ###

s = input()
K = int(input())

ans = []
for i in range(len(s)):
    if K >= ord('z')-ord(s[i])+1 and s[i] != 'a':
        K -= ord('z')-ord(s[i])+1
        ans.append('a')
    else:
        ans.append(s[i])

if K >= 1:
    ans[-1] = chr(ord(ans[-1])+K % 26)

print(''.join(ans))
a = []
while True:
    n = int(input())
    if n == 0:
        break
    a.append(n)

for i in range(len(a)):
    b = list(str(a[i]))
    sum = 0
    for j in b:
        sum += int(j)
    print(sum)))

### FIXED CODE ###

a = []
while True:
    n = int(input())
    if n == 0:
        break
    a.append(n)

for i in range(len(a)):
    b = list(str(a[i]))
    sum = 0
    for j in b:
        sum += int(j)
    print(sum)
import numpy as np

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

B = np.zeros(3 * 10**9, dtype = "int32")

ans = 0

for index, A in enumerate(As):
    ans += B[index-A]

    B[index+A] += 1
#    print(list(B[:20]))

print(ans)


### FIXED CODE ###

from collections import defaultdict
import numpy as np
import collections

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

B = defaultdict(int)

ans = 0

for index, A in enumerate(As):
    ans += B[index-A]
    
    B[index+A] += 1
#    print(B)
#    print(list(B[:20]))

print(ans)
A=int(input())
print("A+1")

### FIXED CODE ###

A=ord(input())
print(chr(A+1))
def zen(t):
    aa=0
    for i in range(len(t)-1):
        if t[i]==t[i+1]:
            aa+=1
        if len(t)-1==aa:
            return True
        else:
            return False

s=input()
k=int(input())
cnt=[]
ans=0
c=1
if zen(s):
    print(len(s)*k//2)
else:
    for i in range(len(s)-1):
        if s[i]==s[i+1]:
            c+=1
        else:
            cnt.append(c)
            c=1
        if i==len(s)-2:
            cnt.append(c)
    ans=0
    if s[0]==s[-1] and cnt[-1]%2==1 and cnt[0]%2==1:
        for i in range(len(cnt)):
            ans+=cnt[i]//2
        print(ans*k+(k-1))
    else:
        for i in range(len(cnt)):
            ans+=cnt[i]//2
        print(ans*k)

### FIXED CODE ###

def is_all(t):
    for i in range(len(t)-1):
        if t[i]!=t[i+1]:
            return False
    return True

s=input()
n=len(s)
k=int(input())
cor=[1]
ans=0
c=1
if is_all(s):
    print(n*k//2)
    exit()
i=0
while i<n-1:
    if s[i]==s[i+1]:
        cor[0]+=1
        i+=1
    else:
        i+=1
        break
while i<n-1:
    if s[i]==s[i+1]:
        cor.append(1)
        while i<n-1:
            if s[i]==s[i+1]:
                cor[-1]+=1
                i+=1
            else:
                break
    i+=1
#print(cor)
if s[0]==s[-1]:
    for i in range(1,len(cor)-1):
        ans+=cor[i]//2
    ans*=k
    ans+=(cor[0]+cor[-1])//2*(k-1)
    print(ans+cor[0]//2+cor[-1]//2)
else:
    for i in range(len(cor)):
        ans+=cor[i]//2
    print(ans*k)
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
# from fractions import gcd
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 functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N, K = MAP()

    ans = gcd(N, K) 
    print(0 if ans == 1 else ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
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 functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N, K = MAP()

    r = N%K
    if r == 0:
        print(0)
    else:
        if 2*r > K:
            print(abs(r - K))
        else:
            print(r)


if __name__ == '__main__':
    main()
A，B，C=list(map(int,input().split()))
vincent=[A,B,C]
vincent1=list(set(vincent))
if len(vincent1)==2:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

A, B, C = list(map(int, input().split()))
vincent = [A,B,C]
vincent1 = list(set(vincent))
if len(vincent1) == 2:
    print("Yes")
else:
    print("No")
import math
a=int(input())
list=[]
for i in range(1,int(math.sqrt(a))+1):
  if a%i==0:
    list.append(i+int(a/i)-2)
b=min(list)
print(b)

### FIXED CODE ###

a = input().split(" ")
if int(a[0]) <= 9 and int(a[1]) <= 9:
  print(int(a[0])*int(a[1]))
else:
  print(-1)
import math
from functools import reduce

S = list(map(int,input().split()))
N = S[0]
X = S[1]
x = list(map(int,input().split()))
x.append(X)
xmin = min(x)
xlist = list(map(lambda y: y-xmin ,x))
xlist.remove(0)

answer = reduce(math.gcd, xlist)
print(answer)

### FIXED CODE ###

import fractions
from functools import reduce

S = list(map(int,input().split()))
N = S[0]
X = S[1]
x = list(map(int,input().split()))
x.append(X)
xmin = min(x)
xlist = list(map(lambda y: y-xmin ,x))
xlist.remove(0)

answer = reduce(fractions.gcd, xlist)
print(answer)
from functols import reduce
from fractions import gcd
N,X = map(int, input().split())
x =[abs(X-int(i)) for i in input().split()]
print(reduce(gcd,x))

### FIXED CODE ###

import bisect
import math
from functools import reduce

def gcd(A):
    return reduce(math.gcd, A)

N,X = map(int, input().split())
x = sorted(map(int, input().split()))
bisect.insort(x,X)
ans = [x[i+1]-x[i] for i in range(N)] 
if N ==1:
    print(x[1]-x[0])
else:
    print(gcd(ans))
def f(y,x,c0):
  global A
  c=A[y][x]
  if c==" " or c!=c0:
    return 0
  else:
    A[y][x]=" "
    for i,j in [[0,-1],[0,1],[-1,0],[1,0]]:
      f(y+i,x+j,c0)
    return 1

while 1:
  H,W=map(int,raw_input().split())
  if H==W==0: break
  A=[[" " for _ in range(W+2)] for _ in range(H+2)]
  for i in range(H):
    s=raw_input()
    for j in range(W): A[i+1][j+1]=s[j]
  c=0
  for i in range(1,H+1):
    for j in range(1,W+1):
      c+=f(i,j,A[i][j])
  print c

### FIXED CODE ###

def f(y,x,a):
  M.append([y,x])
  while M:
    y,x=M.pop()
    if A[y][x]==a:
      A[y][x]=' '
      for i,j in [[0,-1],[-1,0],[0,1],[1,0]]: M.append([y+i,x+j])
  return 1

M=[]
while 1:
  H,W=map(int,raw_input().split())
  if H==W==0: break
  A=[list(' '*(W+2)) for _ in range(H+2)]
  for i in range(H): A[i+1][1:W+1]=list(raw_input())
  c=0
  for i in range(1,H+1):
    for j in range(1,W+1):
      a=A[i][j]
      if a!=' ': c+=f(i,j,a)
  print c
import sys
import heapq

def end(flag):
    if flag:
        print('Yes')
    else:
        print('No')
    exit(0) #プログラムを終了

n = int(input())
plus = []
minus = []
zero = []
total = 0
for i in range(n):
    s = input()[:-1] #入力の右端の値を除去
    cnt = 0
    M = 0
    m = 0
    for t in s:
        if t == ')': #前から探索
            cnt += 1
            M = max(M,cnt) #'('が多い場合はcnt=0,')'が多い場合はcntは'('と')'の個数の差
        else:
            cnt -= 1
    cnt = 0
    for t in s[::-1]: #後ろから探索
        if t == ')':
            cnt += 1
        else:
            cnt -= 1
            m = min(m,cnt) #')'が多い場合はcnt=0,'('が多い場合はcntは'('と')'の個数の差
    if cnt > 0:
        minus.append((-m,cnt))
    elif cnt == 0:
        zero.append((-m,M))
    else:
        plus.append((M,-cnt))
    S = (M,-cnt)
    total += cnt
if total != 0:
    end(0)
plus.sort()
minus.sort()
cnt = 0
for need,increase in plus:
    if cnt < need:
        end(0)
    else:
        cnt += increase
cnt = 0
for need,increase in minus:
    if cnt < need:
        end(0)
    else:
        cnt += increase
for m,M in zero:
    if m > cnt or M > cnt:
        end(0)
end(1)

### FIXED CODE ###

S = input()
T = input()
length = len(S)
T2 = T[0:length]

if S == T2:
    print('Yes')
else:
    print('No')
[a, b] = [int(x) for x in input().split()]

if a < b:
    print(int(a) + '<' + int(b))
else if a > b:
    print(int(a) + '>' + int(b))
else:
    print(int(a) + '=='+ int(b))

### FIXED CODE ###

[a, b] = [int(_) for _ in input().split()]

if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b')
n = input()
s = input()
x = 0
y = 0

for i in range(n):
  if s[i] == "I":
    y += 1
    x = max(x,y)
  if s[i] == "D":
    y = y - 1
	x = max(x,y)
print(x)

### FIXED CODE ###

input()
s=input()
c,m=0,0
for i in range(len(s)):
    if s[i]=="I":
        c+=1
        m=max(c,m)
    if s[i]=="D":
        c=c-1
        m=max(c,m)
print(m)
N = list(map(int,input(),split()))
A = N.sort()
print(A)

### FIXED CODE ###

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

A = abs(N[0]-N[1])
B = abs(N[1]-N[2])

print(A+B)
n = int(input())
blue = [input() for i in range(n)]
m = int(input())
red = [input() for i in range(n)]
x = 0
for w in set(blue):
    x = blue.count(w) - red.count(w) if blue.count(w) - red.count(w) > x else pass
print(x)


### FIXED CODE ###

n = int(input())
blue = [input() for i in range(n)]
m = int(input())
red = [input() for i in range(m)]
x = 0
for w in set(blue):
    tmp = blue.count(w) - red.count(w)
    if tmp > x:
        x = tmp
print(x)
n=input()
if n==1:
  print('Hello World')
else:
  a=int(input())
  b=int(input())
  print(a+b)


### FIXED CODE ###

n=int(input())
if n==1:
  print('Hello World')
else:
  a=int(input())
  b=int(input())
  print(a+b)
import collections
import math
 
N = int(input())
words = [input() for i in range(N)] 
 
ans = 0
L = []
for ix, word in  enumerate(words):
    word_list = list(word)
    word_list.sort()
    L.append(''.join(map(str, word_list)))
 
c = collections.Counter(L)
 
for i in c.values():    
    ans += math.factorial(i) / math.factorial(2) / math.factorial(i - 2)
 
print(int(ans))

### FIXED CODE ###

N = int(input())
dic = {}

for i in range(N):
    spell = ''.join(sorted(input()))
    if spell in dic.keys():
        dic[spell] += 1
    else:
        dic[spell] = 1

count = 0
for num in dic.values():
    count += sum([i for i in range(num)])

print(count)
import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
def ddprint(x):
  if DBG:
    print(x)

def foo(x):
    sum = 0
    for y in a:
        sum += abs(y-x)
    return sum+b

a = []
b = 0
q = inn()
for i in range(q):
    x = inl()
    if len(x)==1:
        z = (len(a)-1)//2
        print("{} {}".format(a[z],foo(a[z])))
    else:
        z = x[1]
        if a[-1] <= z:
            a.append(z)
        elif z <= a[0]:
            a.insert(0,z)
        else:
            up = len(a)-1
            lo = 0
            while lo+1 < up:
                mid = (lo+up)//2
                if z < a[mid]:
                    up = mid
                else:
                    lo = mid
            a.insert(up,z)
            b += x[2]


### FIXED CODE ###

import heapq
#printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
#inm   = lambda:      map(int, input().split())
DBG = True  and False
#def ddprint(x):
#  if DBG:
#    print(x)

q = inn()
x = inl()
root = x[1]
b = x[2]
tl = []
tr = []
nl = nr = suml = sumr = 0
#ddprint("q " + str(q))
for i in range(1,q):
    #ddprint("i " + str(i))
    x = inl()
    if len(x)==1:
        z = sumr - suml - (root if nr>nl else 0) + b
        print("{} {}".format(root,z))
    else:
        a = x[1]
        b += x[2]
        if nl == nr:
            aa = -heapq.heappushpop(tl,-a)
            suml += a - aa
            if aa<root:
                aa,root = root,aa
            heapq.heappush(tr,aa)
            sumr += aa
            nr += 1
        else:
            aa = heapq.heappushpop(tr,a)
            sumr += a - aa
            if aa>root:
                aa,root = root,aa
            heapq.heappush(tl,-aa)
            suml += aa
            nl += 1
        #ddprint("b {} root {} nl {} nr {} suml {} sumr {}".format(b,root,nl,nr,suml,sumr))
        #ddprint(tl)
        #ddprint(tr)
a,b=[int(x) for x in input().split()]
if a > b:
 print(a + '>' + b)
else if a = b:
 print(a + '==' + b)
else:
 print(a + '<' + b)


### FIXED CODE ###

a,b=[int(x) for x in input().split()]
if a > b:
 print('a > b')
elif a == b:
 print('a == b')
else:
 print('a < b')
m,n = map(int, input().split())
if n >= 1<<m:
  print(-1)
   
else:
  if m == 1:
    if n == 1:
      print(-1)
    else:
      print(0 0 1 1)
  else:
    ans = [i for i in range((1<<m)-1, -1, -1)]
    ans.remove(n)
    ans.append(n)
    for i in range(1<<m):
      if i == n:
        continue
      else:
        ans.append(i)
    ans.append(n)
    print(" ".join(map(str, ans)))


### FIXED CODE ###

m,n = map(int, input().split())
if n >= 1<<m:
  print(-1)
   
else:
  if m == 1:
    if n == 1:
      print(-1)
    else:
      print(0,0,1,1)
  else:
    ans = [i for i in range((1<<m)-1, -1, -1)]
    ans.remove(n)
    ans.append(n)
    for i in range(1<<m):
      if i == n:
        continue
      else:
        ans.append(i)
    ans.append(n)
    print(" ".join(map(str, ans)))
N = map(int, input().split())

area = (N * N * 3.14)
len = (N * 2 * 3.14)

print('{} {}'.format(area, len))

### FIXED CODE ###

ci = 3.14159265359
n = float(input())
print('{0:f} {1:f}'.format(n*n*ci, (n+n)*ci))
n, k = map(int, input().split())
A = map(int,input().split())
flag = [True]*n
p = 0
rt = [1]

while flag[p]:
    flag[p] = False
    p = A[p] -1
    rt.append(p+1)

to_p = rt.index(rt[-1])
p2p = rt[to_p:-1]
p2p_len = len(p2p)

if k < p2p_len:
    print(rt[k])
else:
    print(p2p[(k-to_p)%p2p_len])

### FIXED CODE ###

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

s = [True] * n  
c = [1]  
now = 0  
while s[now]:
    s[now] = False  
    now = a[now] - 1
    c.append(now+1)

start_cycle = c.index(c[-1]) 
loop = c[start_cycle:-1]  
cycle = len(loop)

if k < start_cycle:  
    print(c[k])
else:
    k -= start_cycle
    k %= cycle
    print(loop[k])
a,b,c,d,e,f=map(int,input().split())
aa=0
ans=[0,0]
for i in range(0,f+1,a*100):
  for j in range(0,f+1-i,b*100):
    for k in range(0,e*(i+j)/100+1,c):
      for l in range(0,e*(i+j)/100+1-k,d):
        if i+j+k+l>f:
          continue
        if i+j>0 and aa<(k+l)/(i+j+k+l):
          aa=(k+l)/(i+j+k+l)
          ans=[i+j+k+l,k+l]
print(ans[0],ans[1])
        

### FIXED CODE ###

a,b,c,d,e,f=map(int,input().split())
aa=-1
ans=[0,0]
for i in range(0,f+1,a*100):
  for j in range(0,f+1-i,b*100):
    for k in range(0,int(e*(i+j)/100)+1,c):
      for l in range(0,int(e*(i+j)/100)+1-k,d):
        if i+j+k+l>f:
          continue
        if i+j>0 and aa<(k+l)/(i+j+k+l):
          aa=(k+l)/(i+j+k+l)
          ans=[i+j+k+l,k+l]
print(ans[0],ans[1])
ans = [None] * 1000
for i in xrange(1000):
    ans[i] = [None] * 1000
for i in range(len1):
        ans[i][0] = 0
    for j in range(len2):
        ans[0][j] = 0
roop = input()
for k in range(roop):
    str1 = raw_input()
    str2 = raw_input()
    len1 = len(str1) + 1
    len2 = len(str2) + 1
    for i in range (1, len1):
        for j in range(1, len2):
            if(str1[i - 1] == str2[j - 1]):
                ans[i][j] = ans[i -1][j - 1] + 1
            else:
                ans[i][j] = max(ans[i - 1][j], ans[i][j - 1])
    print ans[len1 - 1][len2 - 1]

### FIXED CODE ###

def LCS():
    str1 = raw_input()
    str2 = raw_input()
    
    after = [0] * (len(str2) + 1)
    
    for i in xrange(1, len(str1) + 1):
        before = after + []
        for j in xrange(1, len(str2) + 1):
             if str1[i - 1] == str2[j - 1]:
                 after[j] = before[j - 1] + 1
             elif after[j - 1] > before[j]: #this is equal to 'max(after[j - 1], before[j])'
                 after[j] = after[j - 1]
    return after[j]

n = input()
for k in xrange(n):
    print LCS()
S=list(input())
S.append(0)
count=0
people=0
x=[]
x.append(-1)
y=[]
z=[]
for i in range(10**5):
    if S[i]==0:
        All = i
        y.append(0)
        break
    if S[i]=='L':
        if S[i+1]=="R":
            x.append(i)
        if S[i+1]==0:
            x.append(i)
    if S[i]=="R":
        if S[i+1]=="L":
            y.append(i)
for j in range(All):
    if j == y[count]:
        people=x[count+1]-x[count]
        if(people%2==0):
            z.append(people//2)
            z.append(people//2)
    elif j-1==y[count]:
        count+=1
    else:
        z.append(0)
print(*z)

### FIXED CODE ###

S=list(input())
S.append(0)
count=0
people=0
x=[]
x.append(-1)
y=[]
z=[]
for i in range(10**5+1):
    if S[i]==0:
        All = i
        y.append(0)
        break
    if S[i]=='L':
        if S[i+1]=="R":
            x.append(i)
        if S[i+1]==0:
            x.append(i)
    if S[i]=="R":
        if S[i+1]=="L":
            y.append(i)
for j in range(All):
    if j == y[count]:
        people=x[count+1]-x[count]
        if(people%2==0):
            z.append(people//2)
            z.append(people//2)
        else:
            if((y[count]-x[count])%2!=0):
                z.append(people//2+1)
                z.append(people//2)
            else:
                z.append(people//2)
                z.append(people//2+1)
    elif j-1==y[count]:
        count+=1
    else:
        z.append(0)
print(*z)
X = list(int,input().split())

Y =( X[3] + 0.5) / X[1]

print( Y * X[2])

### FIXED CODE ###

#coding:utf-8
a,b,t =map(int,input().split())
x = t // a
print(b*x)
n = int(input())
for i in range(1, n+1):
  hoge = list(map(int, input().split()))
  hoge.append(i)
  r.append(hoge) 
tmp = sorted(r, key=lambda x:x[1], reverse=True)
res = sorted(tmp, key=lambda x:x[0])
for arr in res:
  print(arr[2])

### FIXED CODE ###

n = int(input())
r = []
for i in range(1, n+1):
  hoge = input().split()
  hoge.append(i)
  r.append(hoge) 
tmp = sorted(r, key=lambda x:int(x[1]), reverse=True)
res = sorted(tmp, key=lambda x:x[0])
for arr in res:
  print(arr[2])
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

def coprime(a, b):
    return gcd(a, b) == 1

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

A,B=map(int, input().split())
if coprime(A,B):
  print(1)
else:
  A=make_divisors(A)
  B=make_divisors(B)
  C=list(set(A)&set(B))
  C.sort(reverse=True)
  count=0
  for i in range(len(C)):
    for j in range(i+1,len(C)):
      if (C[j]!=1)and(C[i]%C[j]==0):
        count=count+1
        break
print(len(C)-count)

### FIXED CODE ###

def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

def coprime(a, b):
    return gcd(a, b) == 1

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

A,B=map(int, input().split())
if (A==1)or(B==1)or(coprime(A,B)):
  print(1)
else:
  A=make_divisors(A)
  B=make_divisors(B)
  C=list(set(A)&set(B))
  C.sort(reverse=True)
  count=0
  for i in range(len(C)):
    for j in range(i+1,len(C)):
      if (C[j]!=1)and(C[i]%C[j]==0):
        count=count+1
        break
  print(len(C)-count)