Harryxun/stf_run huggingface dataset:
for i in range(n):
    if s[i] == "A":
        ind_a = i
        break

for i in range(n):
    if s[i] == "Z":
        ind_z = i

print(ind_z - ind_a + 1)

### FIXED CODE ###

s = input()

while True:
  for i, n in enumerate(s):
    if n == "A":
      inda = i
      break
  break

while True:
  for i, n in enumerate(s[::-1]):
    if n == "Z":
      indz = i
      break
  break

indz = len(s) - indz - 1
print(indz - inda + 1)
S = input()
Scount = 0
for i in range(len(S)-1):
    for j in range(1,len(S)):
        if (i+j)<=len(S):
            part_S = S[i:i+j]
            num = int(part_S)
            if num % 673 == 0:
                num = int(num/673)
                if num % 3 ==0:
                    Scount += 1
print(Scount)

### FIXED CODE ###

S = input()
from collections import defaultdict
d = defaultdict(int)
before = 0
for i in range(1,len(S)+1):
    now = (int(S[-i])*pow(10,i,2019)+before) % 2019
    d[now] += 1
    before = now
d[0] += 1
ans = 0
for i in d.values():
    ans += i*(i-1)//2
print(ans)
x = int(input())
if x <= 3:
  print(1):
else:
  a = []
  for i in range(2, x + 1):
    j = 2
    while i ** j < x:
      a.append(i ** j)
  print(max(a))

### FIXED CODE ###

x = int(input())
if x <= 3:
  print(1)
else:
  a = []
  for i in range(2, x + 1):
    j = 2
    while i ** j <= x:
      a.append(i ** j)
      j += 1
  print(max(a))
S=input()
print(S.count(o)*100+700)

### FIXED CODE ###

S=input()
print(S.count("o")*100+700)
import sys
 
operator = sys.stdin.read().split()
     
top = 1
bottom = 6
south = 2
north = 5
east = 3
west = 4
sum = 1
 
for var in operator[1:]:
    if var == "North":
        north,top,south,bottom = top,south,bottom,north
        sum += top
    elif var == "South":
        south,top,north,bottom = top,north,bottom,south
        sum += top
    elif var == "West":
        west,top,east,bottom = top,east,bottom,west
        sum += top
    elif var == "East":
        east,top,west,bottom = top,west,bottom,east
        sum += top
    elif var == "Right":
        south,east,north,west = east,north,west,south
        sum += top
    elif var == "Left":
        south,west,north,east = west,north,east,south
        sum += top
    else:
        print sum
        top = 1
        bottom = 6
        south = 2
        north = 5
        east = 3
        west = 4
        sum = 1

### FIXED CODE ###

# coding: utf-8
# Here your code !
import sys
f = sys.stdin

def North(d):
    d = [d[1]] + [7 -d[0]] + [d[2]]
    return d
      
def East(d):
    d = [7-d[2]] + [d[1]] + [d[0]]
    return d
      
def South(d):
    d = [7-d[1]] + [d[0]] + [d[2]]
    return d
  
def West(d):
    d = [d[2]] + [d[1]] + [7-d[0]]
    return d
  
def Right(d):
    d = [d[0]] + [d[2]] + [7-d[1]]
    return d
  
def Left(d):
    d = [d[0]] + [7-d[2]] + [d[1]]
    return d
  
  
  
while True:
    n = int(f.readline())
    if n == 0:
        break
      
    dice = [1,2,3]
    result = 1
      
    for _ in range(n):
        direction = f.readline().rstrip()
   
        dice = eval(direction+"(dice)")
     
          
        result += dice[0]
      
    print(result)
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
v=V-W
l=B-A
if A+V*T > B+W*T:
  if l%v==0:
    print("YES")
else:
  print("NO")


### FIXED CODE ###

a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

print('YES' if abs(b-a) <= (v-w) * t else 'NO')
def main():
    sequence =list(map(int, "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".split(', ')))
    kth = int(input())
    print(sequence(kth - 1))
       

main()

### FIXED CODE ###

def main():
    sequence =list(map(int, "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".split(', ')))
    kth = int(input())
    print(sequence[kth - 1])
       

main()
import sys
import numpy as np
import math
from functools import reduce
sys.setrecursionlimit(10**6)

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

#b=1
#for i in range(n):
#    b*=a[i]

def lcm_base(x,y):
    return (x*y)//math.gcd(x,y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
c=lcm_list(a)

#print(b)
#print(c)

ans=0
for j in range(n):
    ans+=(c-1)%a[j]

#ans=0
##for i in range(b):
#for i in range(c):
#    f=0
#    for j in range(n):
#        f+=(i+1)%a[j]
#    ans=max(ans,f)

print(ans)



### FIXED CODE ###

import sys
import numpy as np
import math
from functools import reduce
sys.setrecursionlimit(10**6)

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

b=1
for i in range(n):
    b*=a[i]

#def lcm_base(x,y):
#    return (x*y)//math.gcd(x,y)
#def lcm_list(numbers):
#    return reduce(lcm_base, numbers, 1)
#c=lcm_list(a)

#print(b)
#print(c)

ans=0
for j in range(n):
    ans+=(b-1)%a[j]
#    ans+=(c-1)%a[j]

#ans=0
##for i in range(b):
#for i in range(c):
#    f=0
#    for j in range(n):
#        f+=(i+1)%a[j]
#    ans=max(ans,f)

print(ans)
def gcd(a, b):
    md = a % b
    if md == 0:
        return b
    return gcd(b, md)

def lcm(a, b):
    _gcd = gcd(a, b)
    return int((a * b) / _gcd)

def lcm_mlt(a, num_list):
    if len(num_list) == 0:
        return a
    n = num_list.pop()
    a = max(a, n)
    b = min(a, n)
    return lcm_mlt(lcm(a, b), num_list)

n = int(input())
nl = list(set([int(input()) for _ in range(n)]))

print(lcm_mlt(1, nl))

### FIXED CODE ###

from fractions import gcd
def lcm(a,b): return a*b//gcd(a,b)

n = int(input())

ans = 1
for i in range(n):
    t = int(input())
    ans = lcm(t, ans)
print(ans)
N=int(input())
K=int(input())

if K==1:
  print(N[0])
  
else:
  if N[0]==1:
    print(N[1])
  else:
    print(N[0])

### FIXED CODE ###

S=input()
K=int(input())

for i, s in enumerate(S):
  if int(s)==1:
    if i+1 < K:
      continue
    if i+1==K:
      print('1')
      break
  else:
    print(s)
    break
n,q = map(int, input().split())
s =input()
A = [[int(j) for j in input().split()] for i in range(q)]
ls = [0] * (n+1)
for i in range(n-1):
    if s[i] == 'A' and s[i+1] == 'C':
        ls[i+1]= ls[i]+1
    else:
        ls[i+1]= ls[i]

for k in range(q):
    print(ls[[k][0]-1-A[k][1]-1])

### FIXED CODE ###

n,q = map(int, input().split())
s =input()
A = [[int(j) for j in input().split()] for i in range(q)]
ls = [0] * (n+1)
for i in range(n-1):
    if s[i] == 'A' and s[i+1] == 'C':
        ls[i+1]= ls[i]+1
    else:
        ls[i+1]= ls[i]

for k in range(q):
    print(ls[A[k][1]-1]-ls[A[k][0]-1])
N = input()
num = input().split()

count = 0
end=False
while(True):
	div = []
	for i in num:
		if(i % 2 == 0):
			div.append(i/2)
		else:
			print(count)
			end = True
    if(end == True):
		break
	num = div
	count = count + 1


### FIXED CODE ###

n = input()
num = [int(i) for i in input().split()]
count = 0
end=False
while(True):
	div = []
	for i in num:
		if(i % 2 == 0):
			div.append(i/2)
		else:
			print(count)
			end = True
			break
	if(end == True):
		break
	num = div
	count = count + 1
print(a[::-1].rsplit('\n',1)[0])

### FIXED CODE ###

input()
print(' '.join(input().split()[::-1]))
N = int(input())
As = [int(input()) for i in range(N)]

for a in As:
    print(max([i for i in As if i != a]))

### FIXED CODE ###

N = int(input())
As = [int(input()) for i in range(N)]

maxim = max(As)
counter = As.count(maxim)

if counter > 1:
    for a in As:
        print(maxim)
else:
    for a in As:
        if a == maxim:
            print(max([i for i in As if i != a]))
        else:
            print(maxim)
from collections import Counter
import bisect

def sortedexist(list,x):
    if bisect.bisect_left == bisect.bisect_right:
        return False
    else:
        return True

N = int(input())
A = [int(hoge) for hoge in input().split()]
C = Counter(A)
A.sort()
done = dict()
for a in A:
    done[a] = False
dp = [False] * 10**6 + 1

for a in A:
    if done[a]:
        dp[a] = True
    else:
        for j in range(2,1 + (10**6 // a)):
            dp[a*j] = True
        done[a] = True
print(sum([dp[a] == False for a in A ]))

### FIXED CODE ###

N = int(input())
A = [int(hoge) for hoge in input().split()]
A.sort()
M = max(A)
dp = [False] * (M+ 1)
ans = 0
prev = -1
for a in A:
    if dp[a] == False:
        for j in range(2,1 + (M// a)):
            dp[a*j] = True
        if a != prev:
            ans += 1
        else:
            dp[a] = True
            ans -= 1
    prev = a
print(ans)
import math

A, B, C, D = map(int, input().split())
CD = int(C * D // math.gcd(C, D))

B_in_C = int(B/C)
B_in_D = int(B/D)
B_in_CD = int(B/(CD))
B_con = B - (B_in_C + B_in_D - B_in_CD)

A = A-1 if A > 1 else A
A_in_C = int(A/C)
A_in_D = int(A/D)
A_in_CD = int(A/(CD))
A_con = A - (A_in_C + A_in_D - A_in_CD)

print(B_con - A_con)

### FIXED CODE ###

S = input()
 
answer = "Good"
prev_s = S[0]
for s in S[1:]:
  if prev_s == s:
    answer = "Bad"
    break
  prev_s = s
 
print(answer)
while True:
  stones = [0, 0]
  n = input()
  if not n:
    break
  stones.append(input())
  stones[0] = (stones[2] + 1) % 2
  stones.append(1)
  for i in range(n - 1):
    m = input()
    if i % 2 == 1:
      if stones[-2] == m:
        stones[-1] += 1
      else:
        stones.append(m)
        stones.append(1)
    else:
      if stones[-2] == m:
        stones[-1] += 1
      else:
        stones[-3] += stones[-1] + 1
        stones = stones[:-2]
  ans = 0
  for j in range(0, len(stones), 2):
    if stones[j] == 0:
      ans += stones[j + 1]
  print ans

### FIXED CODE ###


while True:
  stones = [0, 0]
  n = input()
  if not n:
    break
  stones.append(input())
  stones.append(1)
  for i in range(n - 1):
    m = input()
    if i % 2 == 1:
      if stones[-2] == m:
        stones[-1] += 1
      else:
        stones.append(m)
        stones.append(1)
    else:
      if stones[-2] == m:
        stones[-1] += 1
      else:
        if len(stones) > 2:
          stones[-3] += stones[-1] + 1
          stones = stones[:-2]
        else:
          stones[-2] = m
          stones[-1] += 1
  ans = 0
  for j in range(0, len(stones), 2):
    if stones[j] == 0:
      ans += stones[j + 1]
  print ans
N = int(input())
A = list(map(int,input().split()))

num = [0]*(max(A)+1)

for i in A:
    num[i] += 1

ans = 0
for i in range(0,max(A)+1):
    if i == 0:
        tmp = num[i] + num[i+1]
    elif i == max(A):
        tmp = num[i-1] + num[i]
    else:
        tmp = num[i-1] + num[i] + num[i+1]
    ans = max(ans,tmp)

print(ans)

### FIXED CODE ###

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

num = [0]*(max(A)+2)

for i in A:
    num[i] += 1
m = max(A)
ans = 0
for i in range(0,max(A)+2):
    if i == 0:
        tmp = num[i] + num[i+1]
    elif i == m+1:
        tmp = num[i-1] + num[i]
    else:
        tmp = num[i-1] + num[i] + num[i+1]
    ans = max(ans,tmp)

print(ans)
input()
#文字列を数字へ
A=list(map(int, input().split()))

count=0

#Aへの繰り返し処理
while all(i%2==0 for i in A):
        count+=1
        A= [i/2 for i in A]


print(count)

### FIXED CODE ###

print(input().count("1"))
class Node:
    def __init__(self,data,parent):
        self.data = data
        self.left = None
        self.right = None
        self.parent = parent
        self.same = 1

class BST:
    def __init__(self):
        self.root = None
    
    def insert(self,data):
        n = self.root
        if n == None:
            self.root = Node(data,None)
            return
        else:
            while True:
                if n.data > data:
                    if n.left is None:
                        n.left = Node(data,n)
                        return
                    n = n.left
                elif n.data < data:
                    if n.right is None:
                        n.right = Node(data,n)
                        return
                    n = n.right
                elif n.data == data:
                    n.same += 1
                    return
    
    def delete_max(self):
        n = self.root
        while True:
            if n.right == None:
                break
            else:
                n = n.right
        tmp = n.data//2
        if n.same > 1:
            n.same -= 1
        else:
            if n.left == None:
                n.parent.right = None
            else:
                n.parent.right = n.left
                n.left.parent = n.parent
        self.insert(tmp)
    
    def sum_bst(self,node):
        if node.left == None and node.right == None:
            return node.data*node.same
        else:
            s = node.data*node.same
            if node.left != None:
                s += self.sum_bst(node.left)
            if node.right != None:
                s += self.sum_bst(node.right)
            return s

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

bst = BST()
for a in list(map(int,input().split())):
    bst.insert(a)
for i in range(M):
    bst.delete_max()
print(bst.sum_bst(bst.root))


### FIXED CODE ###

import heapq

N,M = map(int,input().split())
A = list(map(int,input().split()))
A = list(map(lambda x:x*(-1), A))

heapq.heapify(A)

for _ in range(M):
    A_max = heapq.heappop(A)*(-1)
    heapq.heappush(A, (A_max//2)*(-1))

print(sum(A)*(-1))
n=int(input())
lis=list(map(int,input().split()))
count=1
if 0 in lis:
  print(0)
  exit()
for i in lis:
    count*=i
	if count > 10**18:
    	print(-1)
        exit()
print(count)


### FIXED CODE ###

n = int(input())
lis = list(map(int,input().split()))
ans = 1
if 0 in lis:
  print(0)
  exit()
for num in lis:
  ans *= num
  if ans > 10 ** 18:
    print(-1)
    exit()
print(ans)
n = int(input())
A = list(map(int,input().split))

ans = 0
while all(i%2 == 0 for i in A):
  A = [i/2 for i in A]
  ans += 1

print (ans)

### FIXED CODE ###

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

ans = 0
while all(i%2 == 0 for i in A):
  A = [i/2 for i in A]
  ans += 1

print (ans)
N=int(input())

if N%10 in (2,4,5,7,9):
  print('hon')
elif N%10 in(0,1,6,8):
  print('pon')
else:
  ptint('bon)

### FIXED CODE ###

N=int(input())

def ass(N):
  if N%10 in [2,4,5,7,9]:
    print('hon')
  elif N%10 in [0,1,6,8]:
    print('pon')
  else:
    print('bon')
   
ass(N)
a, b = map( int, input().split())
  print(['Even','Odd'][a * b % 2 == 1])

### FIXED CODE ###

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

d = a * b

if( d % 2 == 0):
  print('Even')
  
else:
  print('Odd')
n = int(input())
dishes = list(map(int, input().split()))
points = list(map(int, input().split()))
bonuses = list(map(int, input().split()))

score = 
prev = 0
for i in dishes:
  score += points[i-1]
  if prev > 0:
    if i = prev + 1: score += bonuses[i-1]
  prev = i

### FIXED CODE ###

n = int(input())
dishes = list(map(int, input().split()))
points = list(map(int, input().split()))
bonuses = list(map(int, input().split()))

score = 0
prev = 0
for i in dishes:
  score += points[i-1]
  if prev > 0:
    if i == prev + 1: score += bonuses[i-2]
  prev = i

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

if S[K-1] == 'A': rep = 'a'
elif S[K-1] == 'B': rep = 'b'
else: rep = 'c'
  
print(S[:K] + rep + S[K+1:])
  

### FIXED CODE ###

N, K = map(int, input().split())
S = input()
 
if S[K-1] == 'A': rep = 'a'
elif S[K-1] == 'B': rep = 'b'
else: rep = 'c'

# (K-1)文字目まで + K文字目 + K+1文字目から
print(S[:K-1] + rep + S[K:])
from collections import defaultdict

n,m=map(int,input().split())
d=defaultdict(list)
for _ in range(m):
  x,y=map(int,input().split())
  d[x-1].append(y-1)

dp=[-1]*n

def rec(v):
  if dp[v]!=-1:
    return dp[v]
  res=0
  for nv in d[v]:
    res=max(res,rec(nv)+1)
  dp[v]=res
  return res

res=0
for v in range(n):
  res=max(res,rec(v))
print(res)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
from collections import defaultdict
n,m=map(int,input().split())
d=defaultdict(list)
for _ in range(m):
  x,y=map(int,input().split())
  d[x-1].append(y-1)

dp=[-1]*n

def rec(v):
  if dp[v]!=-1:
    return dp[v]
  res=0
  for nv in d[v]:
    res=max(res,rec(nv)+1)
  dp[v]=res
  return res

res=0
for v in range(n):
  res=max(res,rec(v))
print(res)
import numpy as np
n = int(input())
a = [int(input()) for i in range(n)]
cnt = [0 for i in range(1000000)]

for ai in a:
  cnt[ai-1] += 1
  
print( (np.array(cnt) % 2).sum())

### FIXED CODE ###

from collections import Counter
n = int(input())
a = Counter([int(input()) for i in range(n)])

cnt = 0
for k, v in a.items():
  if v % 2 == 1:
    cnt += 1
print(cnt)
z=[map(int,t.split())for t in open(0)];print(sum(x*x+y*y<=z[0][1]**2for x,y in z))

### FIXED CODE ###

(n,d),*z=[map(int,t.split())for t in open(0)]
print(sum(x*x+y*y<=d*d for x,y in z))
n,m=map(int,raw_input().split())

a=[]

a=map(int,raw_input().split())
a.sort()
b=[map(int,raw_input().split() )for i in range(m)]
b=sorted(b,key=lambda x: -x[1])
k=0
l=0
for i in range(m):
    if a[k]>b[i][1]:
        break
    for j in range(k,min(n,k+b[i][0])):
        if a[j] < b[i][1]:
                a[j] = b[i][1]
                l=j+1
        else:
           break
    k=l
print(sum(a))


### FIXED CODE ###

n,m=map(int,raw_input().split())

a=[]

a=map(int,raw_input().split())
a.sort()
b=[map(int,raw_input().split() )for i in range(m)]
b=sorted(b,key=lambda x: -x[1])
k=0
l=0
for i in range(m):
    if a[k]>b[i][1]:
        break
    for j in range(k,min(n,k+b[i][0])):
        if a[j] < b[i][1]:
                a[j] = b[i][1]
                l=j+1
        else:
           break
    k=l
    if k==n:
        k=n-1
print(sum(a))
from fractions import gcd
n,k = map(int,input().split())

def process(a,b):
	while flag:
		a,b = max(a,b),min(a,b)
		a = a%b
		if a == 0:
			flag = False

	for i in range(1000):
		a = min(a,abs(a-b))
	return a
if n == 0:
	print(0)
elif k == 1 or n == 1:
	print(0)
else:
	print(process(n,k))




### FIXED CODE ###

from fractions import gcd
n,k = map(int,input().split())

def process(a,b):
	if a%b == 0:
		return 0
	a = a%b

	for i in range(100000):
		a = min(a,abs(a-b))
	return a
if n == 0:
	print(0)
elif n ==1:
	if k == 1:
		print(0)
	else:
		print(1)
elif k == 1:
	print(0)
else:
	print(process(n,k))
n,m,k=map(int, input().split())

a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))

for i in range(1,n):
  a_list[i]=a_list[i-1]+a_list[i]
for i in range(1,n+1):
  b_list[i]=b_list[i-1]+b_list[i]

max_ = 0
for i in range(n):
  if k < a_list[n-i-1]:
    pass
  else:
    for j in range(m):
      if k-a_list[n-i-1] < b_list[m-j-1]:
        pass
      else:
        max_ = max(len(a_list[:n-i])+len(b_list[:m-j]), max_)
        break
print(max_)

### FIXED CODE ###

n, m, k = map(int, input().split(' '))
a_list = list(map(int, input().split(' ')))
b_list = list(map(int, input().split(' ')))
sa = [0] * (n+1)
sb = [0] * (m+1)

for i in range(n):
  sa[i+1] = a_list[i] + sa[i]
for j in range(m):
  sb[j+1] = b_list[j] + sb[j]

best=0
r = m
for i, a in enumerate(sa):
  if a>k:
    break
  while ((a + sb[r]) > k) & (r>=0):
    r-=1
    
  best = max(best,i+r)
      
  
    
print(best)
H,W,M = map(int,input().split())
h = [0]*M
w = [0]*M

from collections import defaultdict
counter_h = defaultdict(int)
counter_w = defaultdict(int)

for i in range(M):
    h[i],w[i] = map(int, input().split())
    counter_h[h[i]] += 1
    counter_w[w[i]] += 1
    
MAX_h = max(counter_h.values())
h_list = [k for k, v in counter_h.items() if v == MAX_h]
MAX_w = max(counter_w.values())


import itertools

ans = MAX_h+MAX_w

if len(h_list)*len(w_list)<=3*10**5:
    X = h_list


    check = 0


    for i in range(M):
            if h[i] in X:
                check += 1

    if len(X)==check:
        ans -= 1
    
print(ans)

### FIXED CODE ###

H,W,M = map(int,input().split())
h = [0]*M
w = [0]*M

from collections import defaultdict
counter_h = defaultdict(int)
counter_w = defaultdict(int)

for i in range(M):
    h[i],w[i] = map(int, input().split())
    counter_h[h[i]] += 1
    counter_w[w[i]] += 1

MAX_h = max(counter_h.values())
h_list = [k for k, v in counter_h.items() if v == MAX_h]
MAX_w = max(counter_w.values())
w_list = [k for k, v in counter_w.items() if v == MAX_w]


ans = MAX_h+MAX_w
check = 0

for i in range(M):
    if counter_h[h[i]]==MAX_h and counter_w[w[i]]==MAX_w:
        check += 1

if len(h_list)*len(w_list)==check:
    ans -= 1

print(ans)
# https://atcoder.jp/contests/abc114/submissions/6262572

from itertools import product
N = input()
n = int(N)
ans = 0
for i in range(len(N)+1):
    for s in product(["3","5","7"],repeat=i):
        if int("".join(s)) <= n and "3" in s and "5" in s and "7" in s:
            ans += 1
print(ans)


### FIXED CODE ###

from collections import deque
N = int(input())
memo = {i:1 for i in [357, 375, 537, 573, 735, 753]}
ans = 0
queue = deque()
mod = [10**i for i in range(10)]
for key in memo.keys():
  if key <= N:
    ans += 1
    queue.append(key)
while queue:
    key = queue.popleft()
    len_key = len(str(key))
    for i in range(len_key):
        for j in [3,5,7]:
            tmp = (key // mod[i]) * mod[i+1] + j * mod[i] + key % mod[i]
            if tmp not in memo and tmp <= N:
                ans += 1
                memo[tmp] = 1
                queue.append(tmp)
print(ans)
import sys
import math

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

if h == 0 and m == 0:
  print(0)
  sys.exit()
  
angle_h = (h*60 + m) * (360 / 12 / 60)
angle_m = m * (360 / 60)

radian = math.radians(angle)
cosine = math.cos(radian)
ans = a*a + b*b - 2*a*b * cosine
ans = math.sqrt(ans)

print(ans)

### FIXED CODE ###

import sys
import math
 
a, b, h, m = map(int, input().split())
 
#if h == 0 and m == 0:
#  print(0)
#  sys.exit()
  
angle_h = (h*60 + m) * (360 / 12 / 60)
angle_m = m * (360 / 60)
 
angle = abs(angle_h - angle_m)
radian = math.radians(angle)
cosine = math.cos(radian)
ans = a*a + b*b - 2*a*b * cosine
ans = math.sqrt(ans)
 
print(ans)
s = input()
if len(s)%2 == 0:
  for i in len(s)//2:
    if s[2*i] != "h" and s[2*i+1] != "i":
      print("No")
      exit()
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s = input()
if len(s)%2 == 0:
  for i in range(len(s)//2):
    if s[2*i] != "h" or s[2*i+1] != "i":
      print("No")
      exit()
  print("Yes")
else:
  print("No")
import numpy as np
import math

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

sum_dif =  sum(B) - sum(A)

difference = list(np.array(B) - np.array(A))
manipulation_A = sum([(d//2) for d in difference if d > 0])
manipulation_B = sum([-d for d in difference if d < 0])

if sum_dif < man_required_A + man_required_B:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

import math

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

total_manipulation =  sum(B) - sum(A)

manipulation_A = 0
manipulation_B = 0

for i in range(N):
    if A[i] < B[i]:
        manipulation_A += math.ceil((B[i] - A[i]) / 2)
        manipulation_B += (B[i] - A[i]) % 2
    elif A[i] > B[i]:
        manipulation_B += A[i] - B[i]

if total_manipulation - max(manipulation_A, manipulation_B) >= 0:
    print("Yes")
else:
    print("No")
A = int(input())
B = int(input())

remain = max(0, A - B * 2)

print(remain)


### FIXED CODE ###

data = input().split()
A = int(data[0])
B = int(data[1])

remain = max(0, A - B * 2)

print(remain)
a = input()
for i in a:
    print(i == "1" and "9" or "1" end="")


### FIXED CODE ###

print(1110 - int(input()))
s=input()
n=len(s)
if not(s==s[::-1]):
  print(No)
  exit()
if not(s[:1+(n-1)/2]==s[:1+(n-1)/2][::-1]):
  print(No) 
  exit()
if not(s[(n+3)/2:]==s[(n+3)/2:]):
  print(No)
  exit()
print(Yes)

       

### FIXED CODE ###

s=input()
n=len(s)
if not(s==s[::-1]):
  print("No")
  exit()
if not(s[:(n-1)//2]==s[:(n-1)//2][::-1]):
  print("No") 
  exit()
if not(s[(n+3)//2-1:]==s[(n+3)//2-1:][::-1]):
  print("No")
  exit()
print("Yes")
if int(input())>=30:
  print(Yes)
else:
  print(No)

### FIXED CODE ###

if int(input())>=30:
    print("Yes")
else:
    print("No")
#include <iostream>
using namespace std;

int main()
{
	int a;
	cin >> a;
	cout << a * a + a + a * a * a <<endl;
}

### FIXED CODE ###

a=int(input())
print(a+a**2+a**3)
import math
a, b = map(int, input().split())
print(a * b // math.gcd(a, b))


### FIXED CODE ###

import fractions
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))
C = input()
c = chr(ord(c)+1)
print(c)

### FIXED CODE ###

C = input()
c = chr(ord(C)+1)
print(c)