Harryxun/stf_run huggingface dataset:
import math
a,b,V = map(int, input().split())

if V >= a * a * b / 2:
    theta = math.atan( a**3 / (2 * (a**2 * b - V)) )

else:
    theta = math.atan(2 * V / (a * b**2))

print(90 - theta * 180 / math.pi)


### FIXED CODE ###

import math
a,b,V = map(int, input().split())

if V == a*a*b:
    print(0)
else:    
    if V >= a * a * b / 2:
        theta = math.atan( a**3 / (2 * (a**2 * b - V)) )

    else:
        theta = math.atan(2 * V / (a * b**2))

    print(90 - theta * 180 / math.pi)
# 動的計画法のテーブルを用意
# dp(n) は頂点nを始点として時の最大有効パスの長さ
dp = [-1] * N

def get_inputs():
    N, M = map(int, input().split())
    
    # グラフgを初期化
    g = [[] for _ in range(N)]
    
    # 辺情報を読み込みgに追加
    for _ in range(M):
        x, y = map(lambda c: int(c) - 1, (input().split()))
        g[x].append(y)
    
    return N, M, g


def getlp(x):
    global dp, g
    
    if dp[x] != -1:
        pass
    elif len(g[x]) == 0:
        dp[x] = 0
    else:
        mxp = 0
        for y in g[x]:
            yp = getlp(y)
            if yp > mxp:
                mxp = yp
        dp[x] = mxp + 1
    
    return dp[x]


if __name__ == "__main__":
    N, M, g = get_inputs()
    
    ans = 0
    for x in range(N):
        dp[x] = getlp(x)
        ans = max(ans, dp[x])
    
    print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)

def get_inputs():
    N, M = map(int, input().split())
    
    # グラフgを初期化
    g = [[] for _ in range(N)]
    
    # 辺情報を読み込みgに追加
    for _ in range(M):
        x, y = map(lambda c: int(c) - 1, input().split())
        g[x].append(y)
    
    return N, M, g


def getlp(x):
    global dp, g
    
    if dp[x] != -1:
        return dp[x]
    elif len(g[x]) == 0:
        dp[x] = 0
        return dp[x]
    else:
        dp[x] = max([getlp(y) for y in g[x]]) + 1
        return dp[x]


N, M, g = get_inputs()

dp = [-1] * N
ans = 0
for x in range(N):
    ans = max(ans, getlp(x))

print(ans)
a,b,c = map (int,input().split())

int T = 0

if a+b == c:
    T = 1
elif b+c == a:
    T = 1
elif a+c == b:
    T = 1

if T == 1:
    print('YES')
else:
    print('NO')




### FIXED CODE ###


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

#list 並び替え→最初と最後足して == 真ん中　ならばYES!!!

can.sort()

if can[0]+can[1] == can[2]:
    print("Yes")
else:
    print("No")
from decimal import
n = int(input())
a = input().split(" ")
kotae=Decimal(1)
lista = [int(n) for n in a]
for i in range(n):
  kotae*=Decimal(lista[i])
if kotae>10**18:
  kotae=-1
print(kotae)
  

### FIXED CODE ###

n = int(input())
a = input().split(" ")
kotae=1
listaa = [int(n) for n in a]
lista = sorted(listaa)
if lista[0]==0:
  print(0)
  exit()
for i in range(n):
  kotae*=lista[i]
  if kotae>10**18:
    kotae=-1
    break
if kotae>10**18:
  kotae=-1
print(kotae)
l = input()
n = int(l)
l = input()
a = list(map(int, input().split(' ')))

if max(a) < sum(a)-max(a):
  print('Yes')
else:
  print('No')


### FIXED CODE ###

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

if max(a) < sum(a)-max(a):
  print('Yes')
else:
  print('No')
a,b = [int(i) for i input().split()]
print(a*b , (a+b)*2)


### FIXED CODE ###

a,b = [int(i) for i in input().split()]
print(a*b,2*(a+b))
while True:
    a,op,c=input().split()
    if op=="+":
        print(int(a)+int(c))
    elif op=="-":
        print(int(a)-int(c))
    elif op=="*":
        print(int(a)*int(c))
    elif op=="/":
        print(int(a)//int(c))


### FIXED CODE ###

while True:
    a,b,c=input().split()
    a=int(a)
    c=int(c)
    
    if b=="+":
        print(a+c)
    elif b=="-":
        print(a-c)
    elif b=="*":
        print(a*c)
    elif b=="/":
        print(a//c)
    else:
        break
S = input()
s = list(S)
p = []
q = []
ans = [0 for i in range(len(s))]
for i in range(len(s)-1):
    if s[i] == 'L' and s[i+1] == 'R':
        p.append(i)
for i in range(len(s)-1):
    if s[i] == 'R' and s[i+1] == 'L':
        q.append(i)
if (p[0]-q[0])%2 == 0:
    ans[q[0]] = -(-(p[0]+1)//2)
else:
    ans[q[0]] = (p[0]+1)//2
ans[q[0]+1] = p[0]+1-ans[q[0]]
for i in range(len(p)-1):
    if (p[i+1]-q[i+1])%2 == 0:
        ans[q[i+1]] = -(-(p[i+1]-p[i])//2)
    else:
        ans[q[i+1]] = (p[i+1]-p[i])//2
    ans[q[i+1]+1] = p[i+1]-p[i]-ans[q[i+1]]
if (p[-1]-q[-1])%2 == 0:
    ans[q[-1]] = -(-(len(s)-p[-1]-1)//2)
else:
    ans[q[-1]] = (len(s)-p[-1]-1)//2
ans[q[-1]+1] = len(s) - p[-1] -1 - ans[q[-1]]
for i in range(len(ans)):
    print(ans[i],end=' ')

### FIXED CODE ###

S = input()
s = list(S)
p = []
q = []
ans = [0 for i in range(len(s))]
for i in range(len(s)-1):
    if s[i] == 'L' and s[i+1] == 'R':
        p.append(i)
for i in range(len(s)-1):
    if s[i] == 'R' and s[i+1] == 'L':
        q.append(i)
if len(p) > 0:
    if (p[0]-q[0])%2 == 0:
        ans[q[0]] = -(-(p[0]+1)//2)
    else:
        ans[q[0]] = (p[0]+1)//2
    ans[q[0]+1] = p[0]+1-ans[q[0]]
    for i in range(len(p)-1):
        if (p[i+1]-q[i+1])%2 == 0:
            ans[q[i+1]] = -(-(p[i+1]-p[i])//2)
        else:
            ans[q[i+1]] = (p[i+1]-p[i])//2
        ans[q[i+1]+1] = p[i+1]-p[i]-ans[q[i+1]]
    if (len(s)+1-q[-1])%2 == 0:
        ans[q[-1]] = -(-(len(s)-p[-1]-1)//2)
    else:
        ans[q[-1]] = (len(s)-p[-1]-1)//2
    ans[q[-1]+1] = len(s) - p[-1] -1 - ans[q[-1]]
else:
    if (len(s)+1-q[-1])%2 == 0:
        ans[q[-1]] = -(-(len(s))//2)
    else:
        ans[q[-1]] = (len(s))//2
    ans[q[-1]+1] = len(s) - ans[q[-1]]
for i in range(len(ans)):
    print(ans[i],end=' ')
k=int(input())
s=input()
if s.len()<=k: print(s)
else: print(s[:k]+"...")


### FIXED CODE ###

k=int(input())
s=input()
if len(s)<=k: print(s)
else: print(s[:k]+"...")
k = input()
s = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(s[k - 1])

### FIXED CODE ###

k = int(input())
s = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(s[k - 1])
a, b, c = map(int, input().split())
print(a if b == c else b if a == c else c if a == b)

### FIXED CODE ###

a, b, c = map(int, input().split())
print(a if b == c else b if a == c else c)
N=input()
list=list(map(int, input().split()))
m=0
while all(a%2==0 for a in list):
  list=[a/2 for a in list]
  m += 1
print(m)


### FIXED CODE ###

s = input()
print(s.count("1"))
count = input()
data = [int(i) for i in input().sprit()]
    print(min(data), max(data), sum(data),)

### FIXED CODE ###

count = input()
data = [int(i) for i in input().split()]

print(min(data), max(data), sum(data))
s = int(input())

if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
  print('Bad')
else:
  print('Good')


### FIXED CODE ###

s = input()

if s[0] != s[1] and s[1] != s[2] and s[2] != s[3]:
  print('Good')
else:
  print('Bad')
x = int(input())
count = 0
q, mod = divmod(x, 11)
count += q*2
if mod > 0:
	if(mod <= 6):
    	count += 1
	else:
    	count += 2
print(count)

### FIXED CODE ###

x = int(input())
count = 0
q, mod = divmod(x, 11)
count += q*2
if mod > 0:
    if(mod <= 6):
        count += 1
    else:
        count += 2
print(count)
a = [input() for i in range(2)]

s = a[0]
t = s[1]

if s == t[:-1]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a = [input() for i in range(2)]

s = a[0]
t = a[1]

if s == t[:-1]:
    print('Yes')
else:
    print('No')
n=int(input())
l=[int(input()) for _ in range(n)]
k=sorted(l)

for i in l:
	if i<k[-1]:
    	print(k[-1])
	if i==k[-1]:
		print(k[-2])

### FIXED CODE ###

n=int(input())
l=[int(input()) for _ in range(n)]
k=sorted(l)

for i in l:
	if i<k[-1]:
		print(k[-1])
	if i==k[-1]:
		print(k[-2])
N = int(input())
life_list = list(map(int, input().split()))
life_list.sort()
while life_list[1] - life_list[0] > 0:
    if life_list[1] == life_list[0]:
        break
	life_list[1] = life_list[1] - life_list[0]
    life_list.sort()
        
print(life_list[0])



### FIXED CODE ###

from fractions import gcd
N = int(input())
life_list = list(map(int, input().split()))
ans = life_list[0]
for A in life_list:
  ans = gcd(ans, A)
        
print(ans)
M=input()
M=48-M
print(M)

### FIXED CODE ###

print(48-int(input()))
D = int(input())
C = list(map(int, input().split()))
S = []
con= 0
for _ in range(D):
    S.append(list(map(int, input().split())))
t = [-1]*D
best = [0]*D
last = [0]*26

for i in range(D-4):#1日ごと
    
    score = [-1]*26
    
    for x in range(26):#どの問題を選ぶか
        if i==0:
            con = 0
        else:
            con = best[i-1]
        
        con += S[i][x]
        #last[x] = i+1
        for j in range(26): #減少量の計算 #問題ごと
            if not j==x:
                con -= C[j]*(i-last[j]+1)

        score[x]=con
    m = -100000
    ii = 0
    for k in range(26):
        if m<score[k]:
            m=score[k]
            ii=k
    
    last[ii]=i+1
    best[i]=score[ii]
    t[i]=ii+1



p2 = [0]*(26**2)
for i in range(26):
    for j in range(26):
        #print(i*26+j)
        p2[i*26+j]+=S[D-4][i]
        p2[i*26+j]+=S[D-3][j]
        for k in range(26):
            if not k==i:
                p2[i*26+j] -= C[k]*(25-last[k])
        for k in range(26):
            if not k==j:
                if k==i:
                    p2[i*26+j] -= C[k]*2
ma = 0
ind = 0
for h in range(26**2):
    if p2[h]>ma:
        ma=p2[h]
        ind = h
t[D-4]= h//26+1
t[D-3]=h%26+1
last[t[D-4]]=361
last[t[D-3]]=362



p2 = [0]*(26**2)
for i in range(26):
    for j in range(26):
        #print(i*26+j)
        p2[i*26+j]+=S[D-2][i]
        p2[i*26+j]+=S[D-1][j]
        for k in range(26):
            if not k==i:
                p2[i*26+j] -= C[k]*(25-last[k])
        for k in range(26):
            if not k==j:
                if k==i:
                    p2[i*26+j] -= C[k]*2
ma = 0
ind = 0
for h in range(26**2):
    if p2[h]>ma:
        ma=p2[h]
        ind = h
t[D-2]= h//26 +1
t[D-1]=h%26 +1
        
    
    
    
    
for i in range(D):
    print(t[i])
#print(best)



### FIXED CODE ###

D = int(input())
C = list(map(int, input().split()))
S = []
con= 0
for _ in range(D):
    S.append(list(map(int, input().split())))
t = [-1]*D
best = [0]*D
last = [0]*26

for i in range(D):#1日ごと
    for x in range(26):#どの問題を選ぶか
        if i==0:
            con = 0
        else:
            con = best[i-1]
        
        con += S[i][x]
        last[x] = i+1
        for j in range(26): #減少量の計算 #問題ごと
            con -= C[j]*(i-last[j]+1)
            
        if con>best[i]:
            last[x]=i+1
            best[i]=con
            t[i]=x+1
            
#print(best)
for i in range(D):
  print(t[i])
import sys
sys.setrecursionlimit(100000)

def set_enable_goal(cur_node, back_paths, enable_goal):
    if cur_node in back_paths:
        for next_node in back_paths[cur_node]:
            if enable_goal[next_node - 1] == 0:
                enable_goal[next_node - 1] = 1
                set_enable_goal(next_node, back_paths, enable_goal)


N, M = map(int, input().split())
MIN = float('-inf')
INF_LIMIT = -MIN

back_paths = {}
all_paths = {}
for i in range(M):
    a, b, c = map(int, input().split())
    if a in all_paths:
        all_paths[a].append((b, c))
    else:
        all_paths[a] = [(b, c)]

    if b in back_paths:
        back_paths[b].append(a)
    else:
        back_paths[b] = [a]


# path cut
enable_goal= [0 for i in range(N)]
enable_goal[N - 1] = 1
set_enable_goal(N, back_paths, enable_goal)

for a, paths in all_paths.items():
    if not enable_goal[a - 1]:
        all_paths[a] = []
    else:
        valid_paths = []
        for b, c in paths:
            if enable_goal[b - 1]:
                valid_paths.append((b, c))
        all_paths[a] = valid_paths


scores = [MIN for i in range(N)]
scores[0] = 0

is_inf = False
for n in range(N):
    for a in range(1, M + 1):
        if a in all_paths:
            for b, c in all_paths[a]:
                scores[b - 1] = max(scores[b - 1], scores[a - 1] + c)

# loop check
if not is_inf:
    prev_score = scores[N - 1]
    for a in range(1, M + 1):
        if a in all_paths:
            for b, c in all_paths[a]:
                scores[b - 1] = max(scores[b - 1], scores[a - 1] + c)
    if prev_score != scores[N - 1]:
        is_inf = True


if is_inf:
    print('inf')
else:
    print(scores[N - 1])

### FIXED CODE ###

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

if C >= A and C <= B:
    print('Yes')
else:
    print('No')
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]

M = 10 * 5 + 1
D = [[0] * M for _ in range(M)]

X = {}
Y = {}
for x, y in xy:
  if x in X:
    X[x].append(y)
  else:
    X[x] = [y]
  if y in Y:
    Y[y].append(x)
  else:
    Y[y] = [x]
  D[x][y] = 1

ans = 0
for xx in X.keys():
  x = X[xx]
  L = len(x)
  if L == 1: continue
  for i in range(L - 1):
    if x[i] not in Y: continue
    y = Y[x[i]]
    for j in range(i + 1, L):
      for k in y:
        if D[k][x[j]] == 0:
          ans += 1

print(ans)



### FIXED CODE ###

N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]

class Union:
  def __init__(s, n):
    s.N = n
    s.L = [-1] * n

  def root(s, x):
    if s.L[x] < 0:
      return x, -s.L[x]
    return s.root(s.L[x])

  def merge(s, x, y):
    a, ar = s.root(x)
    b, br = s.root(y)
    if a == b:
      return True
    if ar < br:
      s.L[b] -= ar
      s.L[a] = b
    else:
      s.L[a] -= br
      s.L[b] = a
    return False

  def getList(s):
    D = []
    DN = [0] * N
    for i in range(N):
      if s.L[i] < 0:
        DN[i] = len(D)
        D.append([])
    for i in range(N):
      D[DN[s.root(i)[0]]].append(i)
    return D

M = 10**5 + 1
xL = [-1] * M
yL = [-1] * M
uni = Union(N)

for i in range(N):
  x = xy[i][0]
  y = xy[i][1]
  if xL[x] != -1:
    uni.merge(xL[x], i)
  if yL[y] != -1:
    uni.merge(yL[y], i)
  xL[x] = i
  yL[y] = i

L = uni.getList()
ans = 0
for t in L:
  xL = [0] * M
  yL = [0] * M
  xN = 0
  yN = 0
  for i in t:
    x, y = xy[i]
    if xL[x] == 0:
      xL[x] = 1
      xN += 1
    if yL[y] == 0:
      yL[y] = 1
      yN += 1
  ans += xN * yN - len(t)

print(ans)
import sys
input = sys.stdin.readline


def main():
    n = int(input())
    A = [int(i) for i in input().split()]

    # MOD = 10 ** 9 + 7
    A.sort()
    s = set()

    ans = 0
    if A[0] != A[1]:
        ans += 1

    for i in range(1, n):
        if A[i - 1] == A[i]:
            continue

        for j in range(i):
            if i in s:
                continue
            elif A[i] % A[j] == 0:
                s.add(i)
                break
        else:
            ans += 1
            # print(f"{i = }, {j = }, {ans = }")

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import numpy as np
import sys
input = sys.stdin.readline


def main():
    n = int(input())
    A = np.array([int(i) for i in input().split()])

    max_dp = np.max(A) + 1
    dp = np.zeros(max_dp, dtype="int32")

    for a in A:
        if dp[a] >= 2:
            continue
        fancy = np.arange(a, max_dp, a)
        dp[fancy] += 2
        dp[a] -= 1
    print(np.sum(dp == 1))


if __name__ == '__main__':
    main()
#C
from collections import Counter
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())
first = sorted(set(a))[-1]
if len(a) == 1 or sorted(set(a))[0] == sorted(set(a))[-1]:
    pass
else:
    second = sorted(set(a))[-2]
for i in a:
    if i != first:
        print(first)
    else:
        print(second)


### FIXED CODE ###

#C
from collections import Counter
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())
b = a.copy()
b.sort()
b.reverse()
fi = b[0]
se = b[1]
for i in a:
    if i == fi:
        print(se)
    else:
        print(fi)
a, b, c = map(input().split())
int(x) = a + b + c
if x % 4 == 0:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

a, b, c = map(int, input().split())
x = str(a) + str(b) + str(c)
if int(x) % 4 == 0:
  print('YES')
else:
  print('NO')
a = input('A: ')
b = input('B: ')
c = int(a + b)

def judge_int():
    if c % 2 == 0:
        return c/2
    elif c % 2 != 0:
        return "IMPOSSIBLE"

print(judge_int())


### FIXED CODE ###

l = map(int, raw_input().split())
a = l[0]
b = l[1]
c = int(a + b)

def judge_int():
    if c % 2 == 0:
        return c/2
    elif c % 2 != 0:
        return "IMPOSSIBLE"

print(judge_int())
numofpoints= int(raw_input())
coords=[]
for index in range(numofpoints):
	x,y= map(int, raw_input.split())
    coords.append((x,y))
    
def factorial(n):
  	if n==0:
      return 1
    else:
		return n*factorial(n-1)

sumofnum=0
c=0
for i in range(numofpoints):
	for j in range(numofpoints):
    	if i!=j:
        	sumofnum+=((coords[i][0]-coords[j][0])**2+(coords[j][1]-coords[j][1])**2)**5
			c+=1
print "%.10f"%(sumofnum/c)

### FIXED CODE ###

print(input()**2)
L,R = [int(x) for x in input().split()]
 
min_ans = 10**18

if R-L>=2019:
  min_ans=0
else:
  for i in range(L,R):
      for j in range(i+1,R+1):
          ans = (i*j)%2019

          if ans < min_ans:
              min_ans = ans
          if min_ans == 0:
              break
print(min_ans)


### FIXED CODE ###

input_arr = [int(x) for x in input().split()]

N = input_arr[0]
A = input_arr[1]
B = input_arr[2]

train = N*A
taxi = B

if train > taxi:
    print(taxi)
else:
    print(train)
import math

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

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


def main():
    a,b = mi()

    print(lcm(a, b))

    
main()


### FIXED CODE ###

#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

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


def main():
    a,b = mi()

    print(lcm(a, b))

    
main()
B,C = list(map(int,input().split()))
n_l = list(map(int,input().split()))
dic = {1:1,2:1.5,3:2,4:2.5,5:3,6:3.5}
A = []
total = 0
for i in range(B-C+1):
    A.append(sum(n_l[i:i+C]))
place = A.index(max(A))
for i in range(C):
    total += dic[n_l[place+i]]
print(total)

### FIXED CODE ###

N,M=list(map(int,input().split()))
l_n=list(map(int,input().split()))
k=[]
j=0
for i in range(1,1001):
   j+=i
   k.append(j/i)
l_n=[k[l_n[i]-1] for i in range(N)]
ans=sum(l_n[0:M])
sum_n=ans
for i in range(N-M):
   sum_n+=l_n[i+M]
   sum_n-=l_n[i]
   ans=max(ans,sum_n)
print(ans)
import sys
n=int(input())
s=input()
if n%2!=0:
  print("No")
  sys.exit()
for i in range(n//2):
  if s[i]!=s[n//2+1]:
    print("No")
    sys.exit()
print("Yes")

### FIXED CODE ###

import sys
n=int(input())
s=input()
if n%2!=0:
  print("No")
  sys.exit()
for i in range(n//2):
  if s[i]!=s[n//2+i]:
    print("No")
    sys.exit()
print("Yes")
n, x = map(int,input().split())
l = list(map(int,input().split()))

cnt = 0
now = 0
while now <= x:
    cnt += 1
    now += l.pop(0)
print(cnt)

### FIXED CODE ###

n, x = map(int,input().split())
l = list(map(int,input().split()))

cnt = 1
now = 0
flg = True
while l:
    now += l.pop(0)
    if now <= x:
        cnt += 1
    else:
      break
print(cnt)
from math import gcd
a,b,c,d = map(int,input().split())
ans = b - a + 1#ok
a -= 1#ok

g = gcd(c,d)
temp = c*d/g
cc = -int(a/c) + int(b/c)
dd = -int(a/d) + int(b/d)
cd = -int(a/temp) + int(b / temp)

if c == 1 or d == 1:
    print(0)
else:
    print(ans - cc - dd + cd)

### FIXED CODE ###

from fractions import gcd
a,b,c,d = map(int,input().split())
ans = b - a + 1#ok
a -= 1#ok

g = gcd(c,d)
temp = c*d//g

cc = -int(a//c) + int(b//c)
dd = -int(a//d) + int(b//d)
cd = -int(a//temp) + int(b // temp)

print(ans - cc - dd + cd)
def find_word(sent, word,s):
    w = word    
    if len(w) > 0 :
        if sent.find(w) >= 0:
            return s
        else:
            s+=1
            return find_word(sent,w[:-1],s)
    else :
        return -1

sent = raw_input()
word = raw_input()

s = find_word(sent,word,s)
if s == -1:
    print "No"
else:
    s = word[len(word)-s:len(word)]

    if sent.find(s) >=0:
        print "Yes"
    else:
        print "No"

### FIXED CODE ###

s = raw_input()
p = raw_input()

s += s

if p in s:
    print "Yes"
else:
    print "No"
x,y = map(int, input().split())
if x == y :
    print(0)
elif (-x) == y:
    print(1)
elif x >= 0 and x <= y:
    print(y-x)
elif x >= 0 and x > y:
    if x <= (-y): #10 -11
        print(abs(x-(-y))+1)
    else: # 10 -9
        print(abs(y-(-x))+1)
elif x < 0 and x > y: # -1 -3
    print(min(abs(x-y)+2, -y -x+1))
elif x < 0 and x < y: # -3 -1
    if (-x) < y: # -5 6
        print(min(abs(y-x),abs(y-(-x))+1))
    else:
        rint(abs(y - x))



### FIXED CODE ###

x,y = map(int, input().split())
if x == y :
    print(0)
elif (-x) == y:
    print(1)
elif x >= 0 and x < y: # 0 1
    print(y-x)
elif x >= 0 and x > y: # 5 4 5 -7
    if x <= (-y): #10 -11
        print(abs(x-(-y))+1)
    else: # 10 -9
        print(min(abs(y-(-x))+1,abs(x-y)+2))
elif x < 0 and x > y: # -1 -3
    print(min(abs(x-y)+2, -y -x+1))
elif x < 0 and x < y: # -3 -1
    if y > 0: # -5 6
        print(min(abs(y-x),abs((-y)-x)+1))
    else:
        print(abs(y - x))
import numpy as np

s = input()
N = len(s)

# 縦：じゃんけんの回数(0回含む）、横：パーを出した回数 そのときの最大スコア
# 1回目のじゃんけんではパーは出せない
scores = np.zeros((N + 1, N // 2 + 1), np.int64)

for i in range(2, N + 1):
    if s[i - 1] == 'g':
        scores[i, 0] = scores[i - 1, 0]
        scores[i, 1:i // 2 + 1] = np.maximum(scores[i - 1, :i // 2] + 1, scores[i - 1, 1:i // 2 + 1])
    else:
        scores[i, 0] = scores[i - 1, 0] - 1
        scores[i, 1:i // 2 + 1] = np.maximum(scores[i - 1, :i // 2], scores[i - 1, 1:i // 2 + 1] - 1)

print(scores[-1].max())

### FIXED CODE ###

s = input()

print(-s.count('p') + len(s) // 2)
def main():
    INF = 10 ** 10
    H, N = list(map(int, input().split(' ')))
    magic = [list(map(int, input().split(' '))) for _ in range(N)]
    memo = [[INF for _ in range(N)] for _ in range(H + 1)]

    def dfs(h, i=None):
        if h <= 0:
            return 0
        if i is not None and memo[h][i] < INF:
            return memo[h][i]
        ret = INF
        for j in range(N):
            a, b = magic[j]
            ret = min(ret, b + dfs(h - a, j))
        if i is not None:
            memo[h][i] = ret
        return ret

    print(dfs(H))


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    INF = 10 ** 10
    H, N = list(map(int, input().split(' ')))
    magic = [list(map(int, input().split(' '))) for _ in range(N)]
    MAX_A = max(list(map(lambda x: x[0], magic)))
    dp = [INF for _ in range(MAX_A + H + 1)]
    dp[0] = 0
    for h in range(1, MAX_A + H + 1):
        for i in range(N):
            a, b = magic[i]
            if h - a < 0:
                continue
            dp[h] = min(dp[h], b + dp[h - a])
    print(min(dp[H:]))


if __name__ == '__main__':
    main()
def factor(x){
  factor=[]
  if x==1:
    return
  else:
  i=2
    while x>1:
      if x%i==0:
        factor.append([i,1])
        x/=i
        while x%i==0:
          factor[-1][1]+=1
          x/=i
      i+=1
    return factor

n,m=(int(i) for i in input().split(' '))
factor=factor(m)
ans=1
for data in factor:
  data[1]=data[1]/n
  ans=ans*(data[0]**data[1])
print(ans)


### FIXED CODE ###

import random

def is_prime(q,k=50):
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

n,m=(int(i) for i in input().split(' '))
for i in range(1,n):
  if m%i==0 and (is_prime(i) or i==1) and is_prime(m//i) and (i==1 or m//i<n):
    print('1')
    exit()
for i in range(n,m+1):
  if i==m:
    print(1)
    break
  if m%i==0:
    print(m//i)
    break
  if m-i-n>0 and m%(m-i-n)==0 and m//(m-i-n)>n:
    print(m-i-n)
    break