Harryxun/stf_run huggingface dataset:
import random
import time
import numpy as np

def decrease(day, schedule, c, s, satisfy):
    ret = 0
    date = [0] * 26

    for d in range(day):
        now = schedule[d] + 1
        date[now] = d + 1
        tmp = 0
        for i in range(26):
            tmp += c[i] * (now - date[i])
        ret += tmp
        satisfy.append(tmp)

    return ret

def change(_from, _to, schedule, c, s, satisfy):
    ret = 0
    date = [0] * 26

    for d in range(_to):
        if d < _from:
            ret += satisfy[d]
            continue

        now = schedule[d] + 1
        date[now] = d + 1
        tmp = 0
        for i in range(26):
            tmp += c[i] * (now - date[i])
        ret += tmp
        satisfy[d] = tmp

    return ret

def Main():
    D = int(input())
    c = tuple(map(int, input().split()))
    s = [tuple(map(int, input().split())) for _ in range(D)]
    
    dissatisfy=[]
    schedule = []
    score = 0
    start = time.time()

    #最大値を足すだけ
    for i in range(D):
        schedule.append(np.argmax(s[i]))
        score += np.max(s[i])
    
    ans = score - decrease(D, schedule, c, s, dissatisfy)
    
    while time.time() - start < 1.9:
        contest = random.randint(0, 25)
        day = random.randint(1, D) - 1
        save = dissatisfy.copy()
        dec = change(day, D, schedule, c, s, dissatisfy)
        score2 = score - s[day][schedule[day]] + s[day][contest]

        if ans < score2 - dec:
            ans = score2 - dec
            score = score2
            schedule[day] = contest
        else:
            dissatisfy = save
        

    for i in range(D):
        print(schedule[i] + 1)

if __name__ == "__main__":
    Main()

### FIXED CODE ###

d = int(input())
c = list(map(int, input().split()))

for _ in range(d):
    s = list(map(int, input().split()))
    ret = -20000
    ans = 1
    for i in range(26):
        tmp = s[i] - c[i] * 200
        if ret < tmp:
            ret = tmp
            ans = i + 1
    print(ans)
N=input()
if   (N=='1'):
            print('Hello word')
            
if   (N=='2'):
    A=input()
    B=input()
            print(A+B)

### FIXED CODE ###

N=int(input())
if   (N==1):
            print('Hello World')
            
if   (N==2):
    A=int(input())
    B=int(input())
    if((A>=1)&(A<=9)):
        if((B>=1)&(B<=9)):
            print(A+B)
t = input()

prev = ""
res = []
for i, x in enumerate(t):
    if x == "?":
        if prev == "" or prev == "D" and (i < len(t) and t[i+1] != "P"):
            res.append("P")
        else:
            res.append("D")
    else:
        res.append(x)
    prev = x
print("".join(res))


### FIXED CODE ###

t = input()

prev = ""
res = []
for i, x in enumerate(t):
    if x == "?":
        if prev == "" and len(t) == 1:
            res.append("D")
        elif prev == "" and (i < len(t) - 1 and t[i+1] == "P"):
            res.append("D")
        elif prev == "" or prev == "D" and (i < len(t) - 1 and t[i+1] != "P"):
            res.append("P")
        else:
            res.append("D")
    else:
        res.append(x)
    prev = res[-1]
print("".join(res))
from collections import defaultdict
import bisect
d1=defaultdict(list)
d2=defaultdict(list)
n,m=map(int,input().split())
l=list(map(int,input().split()))
la=[[] for i in range(n+1)]
for i in range(m):
  a,b=map(int,input().split())
  la[a].append(b)
  la[b].append(a)
lb=[0 for i in range(n+1)]
def dfs(x,y):
  if lb[x]!=0:
    return
  else:
    lb[x]=y
    s=la[x]
    if s==[]:
      pass
    else:
      for i in s:
        dfs(i,y)
c=1
for i in range(1,n+1):
  dfs(i,c)
  c+=1
lc=set(lb)
for i in range(1,n+1):
  d1[lb[i]]+=[i]
  d2[lb[i]]+=[l[i-1]]
ans=0
for i in d1:
  d11=d1[i]
  d12=d2[i]
  for j in d12:
    index=bisect.bisect_right(d11,j)
    if d11[index-1]==j:
      ans+=1
print(ans)

### FIXED CODE ###

import sys
from collections import defaultdict
import bisect
sys.setrecursionlimit(1000000)
d1=defaultdict(list)
d2=defaultdict(list)
n,m=map(int,input().split())
l=list(map(int,input().split()))
la=[[] for i in range(n+1)]
for i in range(m):
  a,b=map(int,input().split())
  la[a].append(b)
  la[b].append(a)
lb=[0 for i in range(n+1)]
def dfs(x,y):
  if lb[x]!=0:
    return
  else:
    lb[x]=y
    s=la[x]
    if s==[]:
      pass
    else:
      for i in s:
        dfs(i,y)
c=1
for i in range(1,n+1):
  dfs(i,c)
  c+=1
lc=set(lb)
for i in range(1,n+1):
  d1[lb[i]]+=[i]
  d2[lb[i]]+=[l[i-1]]
ans=0
for i in d1:
  d11=d1[i]
  d12=d2[i]
  for j in d12:
    index=bisect.bisect_right(d11,j)
    if d11[index-1]==j:
      ans+=1
print(ans)
N = int(input())
A = tuple(map(int,input().split()))

MOD = 10**9+7
count = 0
for i in range(N-1):
  count += ((sum(A[0:i+1])%MOD)*(A[i+1]%MOD))%MOD


print(count%MOD)


### FIXED CODE ###

D,T,S = map(int,input().split())
if D/S <= T:
  print("Yes")
else:
  print("No")
A,B = input()
o = -1
if A >= 10 or B>=10
    print(o)
else:
print(A*B)



### FIXED CODE ###

A,B = map(int,input().split())
o = -1
if A >= 10 or B >= 10:
    print(o)
else:
    print(A*B)
N, M = map(int, input().split())
if not (1 <= M):
    1 // 0
if not (M * 2 + 1 <= N <= 100000:
    1 // 0


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N, M = [int(x) for x in input().split()]
    ans = [[] for j in range(M)]

    if N % 2:
        for i in range(M):
            ans[i].append(i + 1)
            ans[i].append(N - i - 1)
    else:
        memo = 0
        for i in range(M):
            memo = i
            if (i + 1) * 4 >= N:
                break
            ans[i].append(i + 1)
            ans[i].append(N - i - 1)
            memo += 1

        for j in range(memo, M):
            ans[j].append(j + 1)
            ans[j].append(N - j - 2)
    for a in ans:
        print(*a)


if __name__ == '__main__':
    main()
while 1:
    q=float(input())
    if q<0:break
    print(q**(1/3))


####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
########################################################################################################
####################################################
####################################################
########################################################################################################
############################################################################################################################################################
####################################################
####################################################
####################################################
########################################################################################################v
vv####################################################


### FIXED CODE ###

for e in iter(input,'-1'):
 q=float(e)
 x=q/2
 while abs(x**3-q)>=q*1e-5:x-=(x**3-q)/3/x/x
 print(x)
*a=map(int,input().split());print('YNeos'[sum(a)/2!=max(a)::2])

### FIXED CODE ###

*a,=map(int,input().split());print('YNeos'[sum(a)/2!=max(a)::2])
l, r = map(int, input().split())

rem_l = l%2019
rem_r = r%2019

ans = -1

if r - l >= 2019:
    ans = 0

elif rem_l >= rem_r:
    ans = 0

else:
    ans = float('INF')
    for i in range(l, r):
        for j in raneg(i, r):
            temp = (i * j) % 2019
            if temp < ans:
                ans = temp

print(ans)


### FIXED CODE ###

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

rem_l = l%2019
rem_r = r%2019

ans = -1

if r - l >= 2019:
    ans = 0

elif rem_l >= rem_r:
    ans = 0

else:
    ans = float('INF')
    for i in range(l, r+1):
        for j in range(i+1, r+1):
            temp = (i * j) % 2019
            if temp < ans:
                ans = temp

print(ans)
in = split(input())
a = int(in[0])
b = int(in[1])
c = int(in[2])

if a < b && b < c:
    print("yes")
else:
    print("no")

### FIXED CODE ###

a, b, c = map(int, input().split())
 
if (a < b < c):
    print("Yes")
else:
    print("No")
a,b,c = map(int, input().sprit())
A = b/a
if A<c:
  ans = A
else:
  ans = c
print(ans)

### FIXED CODE ###

a,b,c = map(int, input().split())
A = int(b/a)
if A<c:
  ans = A
else:
  ans = c
print(ans)
inp = input()
H = int(inp.split()[0])
W = int(inp.split()[1])
l = []
for i in range(H):
    l.append(list(input().split()))

for i in range(H*2):
    line = []
    for j in range(W):
        line = line + l[(i+1)/2][j]
    print(line)


### FIXED CODE ###

inp = input()
H = int(inp.split()[0])
W = int(inp.split()[1])
l = []
for i in range(H):
    l.append(list(input()))

for i in range(H*2):
    line = ""
    for j in range(W):
        line = line + l[int((i)/2)][j]
    print(line)
N = int(input())
XYH_list = [list(map(int, input().split())) for i in range(N)]

for i in range(0, 101):
    for j in range(0, 101):
        tmpH = 0
        tmpI = i
        tmpJ = j
        for k, xyh in enumerate(XYH_list):
            if k == 0:
                tmpH = xyh[2] + abs(xyh[0] - i) + abs(xyh[1] - j)
                continue
            if xyh[2] == max((tmpH - abs(xyh[0] - i) - abs(xyh[1] - j)), 0):
                if k == N - 1:
                    ans = [str(tmpI), str(tmpJ), str(tmpH)]
                continue
            else:
                break
print(' '.join(ans))

### FIXED CODE ###

N = int(input())
XYH_list = [list(map(int, input().split())) for i in range(N)]
XYH_list = sorted(XYH_list, key=lambda x: x[2], reverse=True)

for xi in range(0, 101):
    for yi in range(0, 101):
        tmpH = 0
        for k in range(N):
            x,y,h = XYH_list[k]
            if k == 0:
                tmpH =h + abs(x - xi) + abs(y - yi)
            if h == max((tmpH - abs(x - xi) - abs(y - yi)), 0):
                if k == N - 1:
                    ans = [str(xi), str(yi), str(tmpH)]
                continue
            else:
                break
print(' '.join(ans))
n = int(input())
x = [int(i) for i in input().split()]
x.sort()

ans = 10000
for p in range(x[1],x[-1]+1):
  sum =0
  for i in range(n):
    sum += (x[i]-p)**2
    
  ans = min(ans,sum)
  
print(ans) 


### FIXED CODE ###

n = int(input())
X= list(map(int,input().split()))
X.sort()

ans = 1000000000
for p in range(1,101):
  sum =0
  for x in X:
    sum += (p-x)**2
    
  ans = min(ans,sum)
  
print(ans)
s1, s2, s3 = input().split()
print(f"A{s2[0]}C")

### FIXED CODE ###

s1, s2, s3 = input().split()
print("{0}{1}{2}".format(s1[0], s2[0], s3[0]))
n,h=map(int,input().split())
d=[]
mx=-1
sm=0
for i in range(n):
    a,b=map(int,input().split())
    mx=max(mx,a)
    d.append([b,a])
da=[]
for i in range(n):
    if d[i][0]>mx:
        da.append(d[i])
da=sorted(da,reverse=True)
i=0
for x in da:
    i+=1
    sm+=x[0]
    if sm>=h:
        print(i)
        exit()
da=sorted(da,key= lambda x:-x[1])
print(i+int((h-sm)/da[0][1]+0.5))



### FIXED CODE ###

import heapq
import math
n,h=map(int,input().split())
used=[0 for i in range(n)]
que=[]
for i in range(n):
    a,b=map(int,input().split())
    heapq.heappush(que,(-b,-a,i))
count=0
while h>0:
    b,a,i=heapq.heappop(que)
    if used[i]:
        b=-b
        count+=math.ceil(h/b)
        break
    else:
        used[i]=1
        h+=b
        count+=1
        heapq.heappush(que,(a,b,i))
print(count)
a = int(input())
b = int(input())
print(a*b)
print(2*a + 2*b)


### FIXED CODE ###

a,b = map(int, input().split())
print(a*b,2*a+2*b)
from math import pi

r = int(input())

# 面積
circle_area = r * r * pi
# 円周
circumference = 2.0 * r * pi

print("{} {}".format(circle_area, circumference))


### FIXED CODE ###

from math import pi

r = float(input())

# 面積
circle_area = r * r * pi
# 円周
circumference = 2.0 * r * pi

print("{} {}".format(circle_area, circumference))
import sys
from collections import defaultdict
dic1 = defaultdict(int)
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
mod = 10**9+7
def pow(n,p,mod=10**9+7): #繰り返し二乗法(nのp乗)
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
def lcm(a,b):
    return (a//gcd(a,b)*b)
n = int(readline())
#dic1
#[正負,比率1(小),比率2(大)]
for i in range(n):
    a,b= map(int,readline().split())
    plamai = 1 if a*b > 0 else 0
    if a < 0:a = -a
    if b < 0:b = -b
    res = gcd(a,b)
    
    dic1[str(plamai)+" "+str(a//res)+" "+str(b//res)] += 1

ans = 1
dic2 = dict()
for i in dic1.keys():
    res = 0
    if not i in dic2:
        a = dic1[i]
        g,d,e = i.split()
        if g == "1":
            res2 = "0"+" "+e+" "+d
        else:
            res2 = "1"+" "+e+" "+d
        if res2 in dic1:
            b = dic1[res2]
        else:b = 0
        if a > 0:
            res += pow(2,a)
        if b > 0:
            res += pow(2,b)
        if a != 0 and b != 0:
            res -= 1
        ans *= res
        ans %= mod
        dic2[res2] = 1

print(ans-1)

### FIXED CODE ###

import sys
from collections import defaultdict
dic1 = defaultdict(int)
dic2 = defaultdict(int)
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
mod = 10**9+7
def pow(n,p,mod=10**9+7): #繰り返し二乗法(nのp乗)
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
def lcm(a,b):
    return (a//gcd(a,b)*b)
def to_standard_form(a, b):
    if a == 0:
        return (0, 1)
    g = gcd(a, b)
    a //= g
    b //= g
    if a < 0:
        return (-a, -b)
    return (a, b)
n = int(readline())
zero = 0
for i in range(n):
    a,b= map(int,readline().split())
    if a == b == 0:
        zero += 1
        continue
    plamai = 1 if a*b > 0 else 0
    a,b = to_standard_form(a,b)
    if b <= 0:
        dic2[(a,b)] += 1
    else:
        dic1[(b,-a)] += 1
        dic2[(b,-a)] += 0

ans = zero
k = 1
for key,cnt in dic2.items():
    cnt2 = dic1[key]
    x = pow(2,cnt)+pow(2,cnt2)
    k = k*(x-1)%mod
print((ans+k-1)%mod)
import numpy as np
H,W,M=map(int, input().split())
hl=np.array([0 for i in range(H+1)])
wl=np.array([0 for i in range(W+1)])
ms=[]
for i in range(M):
    h,w=map(int, input().split())
    hl[h]+=1
    wl[w]+=1
    ms.append([h,w])
a=max(hl)
b=max(wl)
hmax=[]
wmax=[]
s=0
for x in ms:
    if  hl[x[0]]==a and wl[x[1]]==b:
        s+=1
c=hl.count(a)
d=wl.count(b)
if s<c*d:
    print(a+b)
else:
    print(a+b-1)

### FIXED CODE ###


H,W,M=map(int, input().split())
hl=[0 for i in range(H+1)]
wl=[0 for i in range(W+1)]
ms=[]
for i in range(M):
    h,w=map(int, input().split())
    hl[h]+=1
    wl[w]+=1
    ms.append([h,w])
a=max(hl)
b=max(wl)
hmax=[]
wmax=[]
s=0
for x in ms:
    if  hl[x[0]]==a and wl[x[1]]==b:
        s+=1
c=hl.count(a)
d=wl.count(b)
if s<c*d:
    print(a+b)
else:
    print(a+b-1)
a,b,c,d = map(int, input().split())

B-A = (b-a)
C-B = (c-b)
C-A = (c-a)
if B-A <= d and C-B <= d:
    print("Yes")
elif c-a =< d:
    print("Yes") 
else:
    ("No")

### FIXED CODE ###

a,b,c,d = map(int,input().split())
B_A = abs(b - a)
C_B = abs(c - b)
C_A = abs(c - a)
if B_A <= d and C_B <=d:
    print('Yes')
elif C_A <= d:
    print('Yes')
else:
    print('No')
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
B = []
C = []
for _ in range(Q):
  l = map(int, input().split())
  B.append(l[0])
  C.append(l[1])

for i in range(Q):
  for a in A:
    if a == B[i]:
      a = C[i]
  print(sum(A))

### FIXED CODE ###

from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
D = defaultdict(int)
for a in A:
  D[a] += 1
Q = int(input())
B = []
C = []
for _ in range(Q):
  l = list(map(int, input().split()))
  B.append(l[0])
  C.append(l[1])

ans = sum(A)
for i in range(Q):
  k = D[B[i]]
  D[B[i]] = 0
  D[C[i]] += k
  ans = ans - (B[i]*k) + (C[i]*k)
  print(ans)
h,w=map(int,input().split())
a=[]
for i in range(h):
    a.append(list(input()))
    
ans=[]  
for i in range(h-1):
    for j in range(w):
        if a[i][j]%2==1:
            ans.append([i,j,i+1,j])
            a[i+1][j]+=1
  
for j in range(w-1):
    if a[h-1][j]%2==1:
        ans.append([h-1,j,h-1,j+1])
        a[h-1][j+1]+=1
print(len(ans))
for i in range(len(ans)):
    print(ans[i][0],end=" ")
    print(ans[i][1],end=" ")
    print(ans[i][2],end=" ")
    print(ans[i][3])
 

### FIXED CODE ###

h,w=map(int,input().split())
a=[]
for i in range(h):
    a.append(list(map(int,input().split())))
    
ans=[]  
for i in range(h-1):
    for j in range(w):
        if a[i][j]%2==1:
            ans.append([i+1,j+1,i+2,j+1])
            a[i+1][j]+=1
  
for j in range(w-1):
    if a[h-1][j]%2==1:
        ans.append([h,j+1,h,j+2])
        a[h-1][j+1]+=1
print(len(ans))
for i in range(len(ans)):
    print(ans[i][0],end=" ")
    print(ans[i][1],end=" ")
    print(ans[i][2],end=" ")
    print(ans[i][3])
input_list = map(int, raw_input().split())

x = input_list[0]
y = input_list[1]

if x < y:
	tmp = x
	x = y
	y = tmp

x_y_divisor = list()
y_divisor = list()
x_mod_y = x % y


for i in range(1,(x_mod_y)+1):
	if x_mod_y % i == 0:
		x_y_divisor.append(i)


for i in range(1,y+1):
	if y % i == 0:
		y_divisor.append(i)


x_y_divisor_set = set(x_y_divisor)
y_divisor_set = set(y_divisor)

ans_divisor = y_divisor_set.intersection(x_y_divisor_set)
print(max(ans_divisor))



### FIXED CODE ###

import sys

input_list = map(int, raw_input().split())

x = input_list[0]
y = input_list[1]

if x < y:
	tmp = x
	x = y
	y = tmp
elif x == y:
	print(x)
	sys.exit(0)


r = 0
while y != 0:
	r = x % y
	x = y
	y = r

print(x)
N=int(input());R,d,f,s,x=sorted(list(map(int,input().split()))for i in range(N))+[(2e9,0)],[0]*N+[1],[0]*N,1,N
for i in range(N-1,-1,-1):
	while R[x][0]<sum(R[i]):x=f[x]
	d[i]=s=(s+d[x])%998244353;f[i],x=x,i
print(s)

### FIXED CODE ###

print("YNeos"[2-len(set(input()))::2])
import sys
s=[]
dic={"A":["11","11"],"B":["1","1","1","1"],"C":["1111"],"D":["01","11","10"],
		"E":["110","011"],"F":["10","11","01"],"G":["011","110"]}
cnt=0
for line in sys.stdin:
	if line=="":
		continue
	cnt+=1
	if cnt<8:
		s.append(line)
	else:
		cnt=0
		while s[0]=="00000000":
			del s[0]
		while s[len(s)-1]=="00000000":
			del s[len(s)-1]
		i=0
		while i<len(s[0]):
			for l in s:
				if l[i]=="1":
					break
			else:
				for l in range(len(s)):
					s[l]=s[l][0:i]+s[l][i+1:len(s[l])]
				i-=1
			i+=1
		for d in dic.keys():
			if dic[d]==s:
				print d
				break
		while len(s)>0:
			del(s[0])

### FIXED CODE ###

import sys
dic={"A":["11","11"],"B":["1","1","1","1"],"C":["1111"],"D":["01","11","10"],
		"E":["110","011"],"F":["10","11","01"],"G":["011","110"]}
s=[]
linecnt=0
for line in sys.stdin:
	if line=="\n" or line=="":
		continue
	linecnt+=1
	if linecnt<8:
		s.append(line.rstrip("\n"))
	else:
		s.append(line.rstrip("\n"))
		while s[0]=="00000000":
			del(s[0])
		while s[len(s)-1]=="00000000":
			del(s[len(s)-1])
		i=len(s[0])-1
		while i>=0:
			for l in xrange(len(s)):
				if s[l][i]=="1":
					break
			else:
				for l in xrange(len(s)):
					s[l]=s[l][0:i]+s[l][i+1:len(s[l])]
			i-=1
		for d in dic.keys():
			if dic[d]==s:
				print d
				break
		while len(s)>0:
			del(s[0])
		linecnt=0
import collections
N=int(input())
A=[int(x) for x in input().split()]
AA=sorted(A)
c=collections.Counter(A)
third=N//3
answer="No"

#文字が全部0
if all(a==0 for a in A):
  answer="Yes"

#0aa0aaという並びに出来る
#0がN/3個,aが2N/3個で数字は二種類
elif len(c)==2 and N%3==0:
  if all(AA[:third]==0):
    answer="Yes"
     
#abc,abc...,abcという並びに出来る
#aがN/3個,bがN/3個,cがN/3個で数字は三種類
elif len(c)==3 and N%3==0:
  if A.count(AA[0])==third and \
  A.count(AA[third])==third and \
  A.count(AA[2*third])==third:
    answer="Yes"
    
print(answer)

### FIXED CODE ###

import collections
N=int(input())
A=[int(x) for x in input().split()]
AA=sorted(A)
c=collections.Counter(A)
third=N//3
answer="No"

#文字が全部0
if all(a==0 for a in A):
  answer="Yes"

#0aa0aaという並びに出来る
#0がN/3個,aが2N/3個で数字は二種類
elif len(c)==2 and N%3==0:
  if all(a==0 for a in AA[:third]):
    answer="Yes"
     
#abc,abc...,abcという並びに出来る
#aがN/3個,bがN/3個,cがN/3個で数字は三種類
elif len(c)==3 and N%3==0:
  if A.count(AA[0])==third and \
  A.count(AA[third])==third and \
  A.count(AA[2*third])==third:
    if bin(AA[0]^AA[third])==bin(AA[2*third]) and \
    bin(AA[third]^AA[2*third])==bin(AA[0]) and \
    bin(AA[2*third]^AA[0])==bin(AA[third]):
      answer="Yes"
    
print(answer)
from bisect import bisect_left,bisect
n = int(input())
x = list(map(int,input().split()))
t = (n-1).bit_length()
kprv = [[10**10 for i in range(t)] for j in range(n-1)]
for i in range(t):
    for j in range(n):
        if j + 2**i > n-1:
            break
        kprv[j][i] = x[j+2**i] - x[j]

L = int(input())
q = int(input())

for _ in range(q):
    a , b = map(lambda x:int(x)-1,input().split())
    cou = 0
    if a > b:
        a , b = b , a
    now = a
    while now < b:
        cou += 1
        p = L
        while True:
            nex = bisect(kprv[now],p)
            if nex == 0:
                break
            else:
                p -= kprv[now][nex-1]
                now += 2**(nex-1)
    print(cou)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)  # 変更
from bisect import bisect_left,bisect

n = int(input())
x = list(map(int,input().split()))
L = int(input())
t = n.bit_length()
prv = [n-1] * n
for i in range(n):
    prv[i] = bisect(x,x[i]+L) - 1
kprv = [prv]
S = prv
for i in range(t-1):
    kar = [n-1] * n
    for j in range(n):
        kar[j] = S[S[j]]
    kprv.append(kar)
    S = kar

q = int(input())
for _ in range(q):
    a , b = map(lambda x:int(x)-1,input().split())
    if a > b:
        a , b = b , a
    lef = 0
    rig = n-1
    while rig - lef > 1:
        mid = (rig+lef)//2
        p = mid.bit_length()
        now = a
        for i in range(p):
            if (mid>>i) & 1 == 1:
                now = kprv[i][now]
        if now >= b:
            rig = mid
        elif now < b:
            lef = mid
    print(rig)
n = int(input())
if n ==1:
    print('Hello World')
if n ==2:
    a,b = map(int,input().split())
    ans = a+b
    print(ans)

### FIXED CODE ###

n = int(input())
if n ==1:
    print('Hello World')
if n ==2:
    a = int(input())
    b = int(input())
    ans = a+b
    print(ans)
A, B, C, K = map(int, split().input())
print(A - B if K % 2 == 0 else B - A)

### FIXED CODE ###

A, B, C, K = map(int, input().split())
print(A - B if K % 2 == 0 else B - A)
# coding: utf-8


def main():
    
    takahashi_cookie, aoki_cookie, action_count = map(int, input().split(' '))

    if action_count >= (takahashi_cookie + aoki_cookie):
        takahashi_result = 0
        aoki_result = 0
    elif action_count >= takahashi_cookie:
        takahashi_result = 0
        aoki_result = aoki_cookie - (action_count - takahashi_cookie)
    elif action_count < takahashi_cookie:
        takahashi_result = takahashi_cookie - action_count
        aoki_result = aoki_result
        
    print(takahashi_result, aoki_result)

    return 0
    

if __name__ == '__main__':
    main()


### FIXED CODE ###

#coding:utf-8
 
 
def main():
    list1  = list(map(int, input().split(' '))) 
    a, b, k = list1
  
    if a > k:
        a = a - k
      
    elif a + b >= k:
        b = b - (k - a)
        a = 0
        
    else:
        a = 0
        b = 0
        
    print(a, b)
  
    return 0
 
 
if __name__ == '__main__':
    main()
print(x*x*x)


### FIXED CODE ###

x=input()
print(x**3)