Harryxun/stf_run huggingface dataset:
table = [[ 0 for i in range(13)] for j in range(4)]

n = int(input())

i = 0 
while i < n:
    s,num = input().split()
    num = int(num)
    
    if   s == "S":
        table[0][n-1] = 1 
    elif s == "H":
        table[1][n-1] = 1 
    elif s == "C":
        table[2][n-1] = 1 
    else:    # D 
        table[3][n-1] = 1 

    i += 1

for i,elem_i in enumerate(table):
    for j,elem_j in enumerate(elem_i):
        if elem_j ==1:
            continue

        if i == 0:
            s_str='S'
        elif i == 1:
            s_str='H'
        elif i == 2:
            s_str='C'
        else:
            s_str='D'
        print (s_str + " " + str(j+1))


### FIXED CODE ###

table = [[ 0 for i in range(13)] for j in range(4)]

n = int(input())

i = 0 
while i < n:
    s,num = input().split()
    num = int(num)
    
    if   s == "S":
        table[0][num-1] = 1
    elif s == "H":
        table[1][num-1] = 1
    elif s == "C":
        table[2][num-1] = 1
    else:    # D 
        table[3][num-1] = 1

    i += 1

for i,elem_i in enumerate(table):
    for j,elem_j in enumerate(elem_i):
        if elem_j ==1:
            continue

        if i == 0:
            s_str='S'
        elif i == 1:
            s_str='H'
        elif i == 2:
            s_str='C'
        else:
            s_str='D'
        print (s_str + " " + str(j+1))
from math import gcd
N = int(input())
aa = list(map(int, input().split()))
front = [0]*N
back = [0]*N
front[0] = aa[0]
back[-1] = aa[-1]
for i in range(1, N):
    front[i] = gcd(front[i-1], aa[i])
    back[-1-i] = gcd(back[-i], aa[-1-i])
ans = back[1]
for i in range(2, N):
    ans = max(gcd(front[i-2], back[i]), ans)
ans = max(front[-2], ans,)
print(ans)

### FIXED CODE ###

from fractions import gcd
N = int(input())
aa = list(map(int, input().split()))
front = [0]*N
back = [0]*N
front[0] = aa[0]
back[-1] = aa[-1]
for i in range(1, N):
    front[i] = gcd(front[i-1], aa[i])
    back[-1-i] = gcd(back[-i], aa[-1-i])
ans = back[1]
for i in range(2, N):
    ans = max(gcd(front[i-2], back[i]), ans)
ans = max(front[-2], ans,)
print(ans)
if S == ABC:
  print("ARC")
else:
  print("ABC")

### FIXED CODE ###

S = input()
if S == "ABC" : 
  print("ARC")
else :
  print("ABC")
a,b,k=map(int,input().split())

for i in range(1,min(a,b)+1):
  if a%i==0 and b%i==0:
    count+=1
    if count=k:
      print(i)

### FIXED CODE ###

import sys
a,b,k=map(int,input().split())
count=0
for i in reversed(range(1,min(a,b)+1)):
  if a%i==0 and b%i==0:
    count+=1
    if count==k:
      print(i)
      sys.exit()
import sys

sys.setrecursionlimit(200000)

def dfs(i, special):
    if (i > N - 1):
        return 0
    if (special > 0):
        return dfs(i + 1, special - 1)
    if MONSTERS[i] <= 1:
        return 1 + dfs(i + 1, special)
    else:
        MONSTERS[i] -= 1
        return 1 + dfs(i, special)

N, K = map(int, input().split())
MONSTERS = map(int, input().split())
MONSTERS = list(reversed(sorted(MONSTERS)))
print(dfs(0, K))


### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000000)

def dfs(i, special):
    if (i > N - 1):
        return 0
    if (special > 0):
        return dfs(i + 1, special - 1)
    else:
        return  MONSTERS[i] + dfs(i + 1, special)       

N, K = map(int, input().split())
MONSTERS = map(int, input().split())
MONSTERS = list(reversed(sorted(MONSTERS)))
print(dfs(0, K))
candy = int(input())
x = candy.split()
i = 0
for v in x
    if max(x) == v and (i+1)%3 + (i+2)%3 = v:
            print('YES')
            break
    i ++
if i >= 2
    print('NO')

### FIXED CODE ###

candy = input()
x = candy.split()
y = [0,0,0]
for i in range(3):
    y[i] = int(x[i])
i = 0
for v in y:
    if max(y) == v and y[(i+1)%3] + y[(i+2)%3] == v:
            print('Yes')
            break
    i = i+1
if i >= 3:
    print('No')
n=int(input())
k=input()
l=[]
ol=len(k)
nl=len(l)
for i in range(n):
  l.append(k[i])
if(ol>nl):
  print("".join(l)+"...")
else:
  print(k)


### FIXED CODE ###

n=int(input())
k=input()
if(len(k)>n):
  k=k[:n]+"..."
print(k)
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  h,w=LI()
  s=[S() for _ in range(h)]

  ans=0
  for i in range(h):
    for j in range(w):
      if s[i][j]=='#':
        continue

      _ans=-1
      s1=s[a]
      for a in range(i)[::-1]:
        if s1[j]=='.':
          _ans+=1
        else:
          break
      for a in range(i,h):
        if s1[j]=='.':
          _ans+=1
        else:
          break
      for a in range(j)[::-1]:
        if s[i][a]=='.':
          _ans+=1
        else:
          break
      for a in range(j,w):
        if s[i][a]=='.':
          _ans+=1
        else:
          break

      ans=max(ans,_ans)
  return ans

# main()
print(main())


### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  h,w=LI()
  s=[S() for _ in range(h)]

  L=[[0 for _ in range(w)]for __ in range(h)]
  R=[[0 for _ in range(w)]for __ in range(h)]
  D=[[0 for _ in range(w)]for __ in range(h)]
  U=[[0 for _ in range(w)]for __ in range(h)]

  for i in range(h):
    for j in range(w):
      if s[i][j]=='#':
        L[i][j]=0
        U[i][j]=0
        continue

      if i==0:
        U[i][j]=1
      else:
        U[i][j]=U[i-1][j]+1

      if j==0:
        L[i][j]=1
      else:
        L[i][j]=L[i][j-1]+1

  for i in range(h)[::-1]:
    for j in range(w)[::-1]:
      if s[i][j]=='#':
        R[i][j]=0
        D[i][j]=0
        continue

      if i==h-1:
        D[i][j]=1
      else:
        D[i][j]=D[i+1][j]+1

      if j==w-1:
        R[i][j]=1
      else:
        R[i][j]=R[i][j+1]+1

  ans=0
  # print(R,L,D,U)
  for i in range(h):
    for j in range(w):
      ans=max(ans,R[i][j]+L[i][j]+U[i][j]+D[i][j]-3)

  return ans

# main()
print(main())
r d x = map(int, input().split())

for i range (10):
    ans = x * r - d
    print(ans)
    x = ans

### FIXED CODE ###

r,d,x = map(int, input().split())

for i in range(10):
    ans = x * r - d
    print(ans)
    x = ans
s = input()
if S=="ABC":
    print("ARC")
else:
    print("ABC")

### FIXED CODE ###

s = input()
if s=="ABC":
    print("ARC")
else:
    print("ABC")
a,b,N = map(int,input().split())
list =[]
for x in range(N-10000,N+10000):
    list.append(int(a*x/b)-a*int(x/b))
print(max(list))


### FIXED CODE ###

K =int(input())
A,B=map(int,input().split())
list =[]
for i in range(A,B+1):
    list.append(i%K==0)
print("OK" if True in list else "NG")
k,x=map(int,input().split())
print([num in range(x-k+1,x)])

### FIXED CODE ###

k,x=map(int,input().split())
print(*[num for num in range(x-k+1,x+k)])
dic=[{} for i in range(26)]
alpha = "abcdefghijklmnopqrstuvwxyz"

def makedic():
    for i in range(26):
        tmp = alpha[i:]+alpha[:i]
        for j in range(26):
            dic[i][alpha[j]]=tmp[j]
    return

def crack(word):
    for i in range(26):
        s=[]
        for c in word:
            s.append(dic[i][c])
        s="".join(s)
        if s=="the" or s=="this" or s=="that":
            return i
    return None

makedic()
while True:
    try:
        s = raw_input()
    except:
        break

    for e in s.split():
        lene=len(e)
        if lene==3 or lene==4:
            offset = crack(e)
            break
    x = []
    for c in s:
        if "a"<=c and c<="z": x.append(dic[offset][c])
        else: x.append(c)
    print "".join(x)

### FIXED CODE ###

import sys,string
A="abcdefghijklmnopqrstuvwxyza"
tbl=string.maketrans(A[:-1],A[1:])
for s in sys.stdin:
    while not("the" in s or "that" in s or "this" in s):
        s=s.translate(tbl)
    print s[:-1]
a=int(input())
b=int(input())

if (a*b)%2==0:
    print("Even")

else:
    print("Odd")

### FIXED CODE ###

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

if (a*b)%2==0:
    print("Even")

else:
    print("Odd")
n,x=map(int,input().split())
m=[int(input) for _ in range(n)]
m.sort()
num=x-sum(m)
print(n+(num//(min(m)))


### FIXED CODE ###

n,x=map(int,input().split())
m=[int(input()) for _ in range(n)]
m.sort()
num=x-sum(m)
print(n+(num//(min(m))))
t = int(input())
list_v = list(map(int,input().split()))

res = 1
for v in list_v:
  if v = 0:
    return 0
  res = res * v
  if res > 10**18:
    res = -1
    break
print(res)

### FIXED CODE ###

t = int(input())
list_v = list(map(int,input().split()))
 
res = 1
if 0 in list_v:
  res = 0
else:
  for v in list_v:
    res *= v
    if res > 10**18:
      res = -1
      break
print(res)
n, k = [ int(x) for x in input().split(' ') ]
    xs = [  int(x) for x in input().split(' ') ]
    i0 = xs.index(min(xs))
    print(1 + min([ (i + k - 2) // (k - 1) + (n - i - 2) // (k - 1)
      for i in range(max(i0 - k + 1, 0),  min(i0, n - k) + 1)  ]))

### FIXED CODE ###

n, k = [ int(i) for i in input().split(' ') ]
xs = [ int(x) for x in input().split(' ') ]
i0 = xs.index(min(xs))
print(1 + min([ (i + k - 2) // (k - 1) + (n - i - 2) // (k - 1)
  for i in range(max(i0 - k + 1, 0), min(i0, n - k) + 1) ]))
n = int(input())
listV =  list(map(int,input().split()))
sortedListV = sorted(listV)
result = (sortedListV[0] + sortedListV[1]) / 2

for i range (2, n):
    result += (result + sortedListV[i]) / 2
print(result)

### FIXED CODE ###

n = int(input())
listV =  list(map(int,input().split()))
sortedListV = sorted(listV)

for i in range(0 , n-1):
    if (i != 0):
        result = (result + sortedListV[i+1]) / 2
    else:
        result = (sortedListV[i] + sortedListV[i+1]) / 2
print(result)
a=""
a=raw_input()
ans=0
for i in range(len(a)-1):
	if a[i]=='9':
		ans=1
if ans==1:
	print 'Yes'
if ans==0:
	print 'No'

### FIXED CODE ###

a=input()
if a/10==9 or a%10==9:
    print "Yes"
else:
    print "No"
n,m = map(int, input().split()) 
AB = [[] for _ in range(n)]
for i in range(m):
    a, b = map(int,input().split())
    a -= 1
    b -= 1 
    AB[a].append(b)
    AB[b].append(a)

for i in range(n)
    print(len(AB[i]))

### FIXED CODE ###

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

for i in range(n):
    print(len(AB[i]))
n,m=map(int, input().split())
s=input()
t=input()
def euc(x,y):
  if x % y==0:
    return x
  else:
    return euc(max(x,y) % min (x,y),min(x,y))
d=euc(n,m)
ans=int(n*m/d)
if d==1:
  print(n*m)
else:
  for i in range(d):
    if s[i*int(n/d)]!=t[i*int(m/d)]:
      ans=-1
  print(ans)

### FIXED CODE ###

n,m=map(int, input().split())
s=input()
t=input()
def euc(x,y):
  if max(x,y) % min(x,y)==0:
    return min(x,y)
  else:
    return euc(max(x,y) % min (x,y),min(x,y))
d=euc(n,m)
ans=n*int(m/d)
if d==1:
  if s[0]==t[0]:
    print(n*m)
  else:
    print(-1)
else:
  for i in range(d):
    if s[i*int(n/d)]!=t[i*int(m/d)]:
      ans=-1
  print(ans)
import sys

def mink(numk,l):
    x = 1
    for _ in range(k):
        x = a[x-1]
    return x

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

# kが小さい時
if 10**5 <= n and k <= 10**10:
    print(mink(k,a))
    sys.exit()

z = 1
p = [1]
for _ in range(k):
    z = a[z-1]
    if z in p:
        p.append(z)
        break
    p.append(z)

# 周期の来る前の回数
num = p.index(p[-1])

p = p[num:]

# 周期
pn = len(p)-1

k -= num

# 回数/周期のあまり
anum = k%pn
print(p[anum])


### FIXED CODE ###

import sys

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

p = [1]
for i in range(n):
    p.append(a[p[i]-1])

if k <= n:
    print(p[k])
else:
    # 周期の来る前の回数
    num = p.index(p[-1])
    p = p[num:]

    # 周期
    pn = len(p)-1
    k -= num

    # 回数/周期のあまり
    ans = k%pn
    print(p[ans])
a, b = map(int, input())

print(a*b)

### FIXED CODE ###

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

print(a*b)
K = int(input())


if K % 2 == 0:
     print((K//2)**2)
else:
     print((K//2)*((K//2)+1)


### FIXED CODE ###

k = int(input())

if k % 2 == 0:
    print((k//2)**2)
else:
    print((k//2)*((k//2)+1))
n,m = map(int,input().split())
mod = 10**9+7

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

mf = factorize(m)
from collections import Counter

c = Counter(mf)
ans = 1
from scipy.misc import comb
for i in list(c.values()):
  ans*= comb((i+(n-1)),i)

print(round(ans)%mod)

### FIXED CODE ###

n,m = map(int,input().split())
mod = 10**9+7

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

mf = factorize(m)
from collections import Counter

c = Counter(mf)
ans = 1
from scipy.misc import comb
for i in list(c.values()):
  ans*= comb((i+(n-1)),i,exact=True)

print(int(round(ans))%mod)
import bisect
from heapq import heappush, heappop
n = int(input())
a = []
for i in range(n):
    temp = float(input()) * (10**9)
    if temp%1 == 0:
        # print(temp)
        a.append(int(temp))
b = []
d = {0:0,1:0,2:0,3:0,4:0,5:0}
p = [[]for i in range(19)]
for i in a:
    cnt2 = 0
    cnt5 = 0
    while i%2 == 0:
        i //= 2
        cnt2 += 1
    while i%5 == 0:
        i //= 5
        cnt5 += 1
    p[min(19,cnt2)].append(-cnt5)
    # d[min(5,cnt5)] += 1
    # b.append([cnt2,cnt5])
# print(b)
# print(d)
ans = 0
for i in range(19):
    p[i] = sorted(p[i])
# print(p)
for i in range(19):
    while p[i]:
        t = p[i].pop()
        # print(t)
        # for j in p[i]:
        for k in range(max(0,18-i),19):
            # print(k,p[k],t,bisect.bisect_right(p[k],-18-t))
            ans += bisect.bisect_right(p[k],-18-t)
print(ans)
# for i in range(len(a)-1):
#     for j in range(i+1,len(a)):
#         if a[i] > 0 and a[j] > 0 and a[i]*a[j] %(10**8) == 0:
#             ans += 1
#             # print(a[i],a[j])
# print(ans)
# print(a)

### FIXED CODE ###

import bisect
from heapq import heappush, heappop
n = int(input())
a = []
for i in range(n):
    temp = float(input()) * (10**9)
    a.append(int(temp+0.1))
b = []
d = {0:0,1:0,2:0,3:0,4:0,5:0}
p = [[]for i in range(19)]
for i in a:
    cnt2 = 0
    cnt5 = 0
    while i%2 == 0:
        i //= 2
        cnt2 += 1
    while i%5 == 0:
        i //= 5
        cnt5 += 1
    p[min(18,cnt2)].append(-cnt5)
    # d[min(5,cnt5)] += 1
    # b.append([cnt2,cnt5])
# print(b)
# print(d)
ans = 0
for i in range(19):
    p[i] = sorted(p[i])
# print(p)
for i in range(19):
    while p[i]:
        t = p[i].pop()
        # print(t)
        # for j in p[i]:
        for k in range(max(0,18-i),19):
            # print(k,p[k],t,bisect.bisect_right(p[k],-18-t))
            ans += bisect.bisect_right(p[k],-18-t)
print(ans)
# for i in range(len(a)-1):
#     for j in range(i+1,len(a)):
#         if a[i] > 0 and a[j] > 0 and a[i]*a[j] %(10**8) == 0:
#             ans += 1
#             # print(a[i],a[j])
# print(ans)
# print(a)
xs = list(map(int, input().split()))

for i in range(5):
    if xs(i) == 0:
        print(i+1)

### FIXED CODE ###

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

for i in range(5):
    if xs[i] == 0:
        print(i+1)
# C - Remainder Minimization 2019
import numpy as np

l, r = map(int, input().split())

a = np.arange(l, r+1)
a = a%2019
#print(a)
b = np.copy(a)
b = 2019 - b
#print(b)
c = np.minimum(a, b)
c = np.sort(c)
#print(c)

print((c[0]*c[1])%2019)

### FIXED CODE ###

# C - Remainder Minimization 2019
import numpy as np

l, r = map(int, input().split())

ans = 2019
for i in range(l,r):
    for j in range(i+1, r+1):
        ans = min(ans, (i*j)%2019)
        if ans==0:
            break
    else:
        continue
    break

print(ans)
import sys
from math import factorial

def comb(n, r):
    if r < 0:
        return 0
    if n < r:
        return 0
    if n == r:
        return 1
    return factorial(n) / factorial(r) / factorial(n - r)

def main():
    input = sys.stdin.readline
    N = int(input())
    A = list(map(int, input().split()))
    MOD = 10**9 + 7

    used = set()
    first = 0
    second = 0
    for i in range(N+1):
        if A[i] in used:
            second = i
            first = A.index(A[i])
        else:
            used.add(A[i])

    for i in range(1, N+2):
        ans = comb(N+1, i)
        for j in range(i):
            m_f = first
            r_f = j

            m_b = N - second
            r_b = i - (j + 1)

            ans -= comb(m_f, r_f) * comb(m_b, r_b)

        print(int(ans) % MOD)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    A = list(map(int, input().split()))
    MOD = 10**9 + 7

    used = set()
    first = 0
    second = 0
    for i in range(N+1):
        if A[i] in used:
            second = i
            first = A.index(A[i])
        else:
            used.add(A[i])

    factrial = [1] * (N+2)
    for k in range(1, N+2):
        factrial[k] = (factrial[k-1] * k) % MOD

    fact_inv = [1] * (N+2)
    fact_inv[N+1] = pow(factrial[N+1], MOD - 2, MOD)
    for k in range(N, -1, -1):
        fact_inv[k] = (fact_inv[k+1] * (k+1)) % MOD

    def comb(n, r, MOD):
        if n < 0 or r < 0 or n < r:
            return 0
        else:
            return (factrial[n] * fact_inv[r] * fact_inv[n-r]) % MOD

    m = first + (N - second)
    for i in range(1, N+2):
        ans = comb(N+1, i, MOD) - comb(m, i-1, MOD)
        print(int(ans) % MOD)


if __name__ == '__main__':
    main()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
X = int(input())
def f(n):
  if n == 3,5,7:
    print("YES")
  else:
    print("NO")
    
print("{}".format(f(X)))

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
X = int(input())
def f(n):
  if (n == 3)or(n == 5)or(n == 7):
    return "YES"
  else:
    return "NO"
    
print("{}".format(f(X)))
a, b, c, d = map(int, input().split())
l = a + b
r = c + d
if l > r:
  print('Left')
elif l < r:
  print('Right')
else:
  pritn('Balanced')

### FIXED CODE ###

a, b, c, d = map(int, input().split())
l = a + b
r = c + d
if l > r:
    print('Left')
elif l < r:
    print('Right')
else:
    print('Balanced')
def maximal():
    query = input().split('\n')
    B = query[1]
    B = B.split()
    B = [int(i) for i in B]
    # length of values is N
    # any number more or equals than 0
    result = []
 
    result.append(B[0])
 
    for i in range(0, len(B) - 1):
        # if value is same put in first one
        compared = B[i]
        if B[i + 1] <= compared:
            result.append(B[i + 1])
        else:
            result.append(B[i])
 
    result.append(B[len(B) - 1])
    return sum(result)
 
 
print(maximal())

### FIXED CODE ###

def maximal():
    N = int(input())
    B = input()
    B = B.split()
    B = [int(i) for i in B]
    # length of values is N
    # any number more or equals than 0
    result = []
 
    result.append(B[0])
 
    for i in range(0, len(B) - 1):
        # if value is same put in first one
        compared = B[i]
        if B[i + 1] <= compared:
            result.append(B[i + 1])
        else:
            result.append(B[i])
 
    result.append(B[len(B) - 1])
    return sum(result)
 
 
print(maximal())
N = int(input())
 
count = 0

    for i in range(1,int(N)):
        if int(N/i)-N/i == 0:
            count += int(N/i)-1
        else:
            count += int(N/i)
 
 
 
print(count)

### FIXED CODE ###

N = int(input())
NR = int(N**0.5)
count = 0
if int(N/2)-N/2 == 0:
    for i in range(1,int(N/2)):
        if int(N/i)-N/i == 0:
            count += int(N/i)-1
        else:
            count += int(N/i)
else:
    for i in range(1,int(N/2)+1):
        if int(N/i)-N/i == 0:
            count += int(N/i)-1
        else:
            count += int(N/i)

count += int(N/2)
print(count)
a,b,t＝map(int,input().split())
print(t//a*b)


### FIXED CODE ###

a,b,t=map(int,input().split())
print(t//a*b)
w, h, x, y = map(int, input().split())
print(float(w) * float(h) / 2, 1 if w/2 == x & h / 2 == y else 0)


### FIXED CODE ###

w, h, x, y = map(int, input().split())
print(float(w) * float(h) / 2, 1 if (w/2 == x) & (h / 2 == y) else 0)
# -*- coding: utf-8 -*-


def bubble_sort(cards, num):
  for left in range(num-1):
        for right in range(left+1, num):
            if cards[right][1] < cards[left][1]:
                cards[left], cards[right] = cards[right], cards[left]

    print(list_to_str(cards))


def selection_sort(cards, num):
    for head in range(num):
        min_i = head

        for target in range(head+1, num):
            if cards[target][1] < cards[min_i][1]:
                min_i = target
        cards[head], cards[min_i] = cards[min_i], cards[head]

    print(list_to_str(cards))


def is_stable(before, after, num):
    for i in range(num):
        for j in range(i+1, num):
            for a in range(num):
                for b in range(a+1, num):
                    if before[i][1] == before[j][1]\
                    and before[i] == after[b]\
                    and before[j] == after[a]:
                        return 'Not stable'
    return 'Stable'


def list_to_str(l, delimiter=' '):
    # The default delimiter is one space.
    return delimiter.join([str(v) for v in l])


if __name__ == '__main__':
    num = int(input())
    cards = input().split()
    cards_for_bubble = cards.copy()
    cards_for_selection = cards.copy()

    bubble_sort(cards_for_bubble, num)
    print(is_stable(cards, cards_for_bubble, num))

    selection_sort(cards_for_selection, num)
    print(is_stable(cards, cards_for_selection, num))

### FIXED CODE ###

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


def bubble_sort(cards, num):
    for tail in range(num-1, 0, -1):
        for right in range(0, tail):
            left = right + 1
            if cards[left][1] < cards[right][1]:
                cards[right], cards[left] = cards[left], cards[right]

    print(list_to_str(cards))


def selection_sort(cards, num):
    for head in range(num):
        min_i = head

        for target in range(head+1, num):
            if cards[target][1] < cards[min_i][1]:
                min_i = target
        cards[head], cards[min_i] = cards[min_i], cards[head]

    print(list_to_str(cards))


def is_stable(before, after, num):
    for i in range(num):
        for j in range(i+1, num):
            for a in range(num):
                for b in range(a+1, num):
                    if before[i][1] == before[j][1]\
                    and before[i] == after[b]\
                    and before[j] == after[a]:
                        return 'Not stable'
    return 'Stable'


def list_to_str(l, delimiter=' '):
    # The default delimiter is one space.
    return delimiter.join([str(v) for v in l])


if __name__ == '__main__':
    num = int(input())
    cards = input().split()
    cards_for_bubble = cards.copy()
    cards_for_selection = cards.copy()

    bubble_sort(cards_for_bubble, num)
    print(is_stable(cards, cards_for_bubble, num))

    selection_sort(cards_for_selection, num)
    print(is_stable(cards, cards_for_selection, num))
import math

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

aa=a*a
bb=b*b


mm=m*6

hh=h*30+30*m/60
if hh-mm<=180:
    cos = math.cos(math.radians(abs(hh-mm)))
else:
    cos = math.cos(math.radians(abs(360-(mm-hh))))
#print(cos)
cc=aa+bb-2*a*b*cos

c=math.sqrt(cc)

print(c)



### FIXED CODE ###

a=input()

if a[-1]=='3':
    print('bon')
elif a[-1]=='0' or a[-1]=='1' or a[-1]=='6' or a[-1]=='8':
    print('pon')
elif a[-1]=='2' or a[-1]=='4' or a[-1]=='5' or a[-1]=='7' or a[-1]=='9':
    print('hon')