Harryxun/stf_run huggingface dataset:
from numpy.linalg import matrix_power

class mint:
    def __init__(self, n):
        self.n = n % mod

    def __add__(self, other):
        return mint(self.n + other.n)

    def __mul__(self, other):
        return mint(self.n * other.n)

    def __repr__(self):
        return str(self.n)


L, A, B, mod = map(int, input().split())

ans = [mint(0), mint(A), mint(B)]

size = 0
for d in range(1, 19):
    x = pow(10, d, mod)
    T = [
        [mint(x), mint(0), mint(0)],
        [mint(1), mint(1), mint(0)],
        [mint(0), mint(1), mint(1)],
    ]

    cnt = min(L - size, max(0, 10 ** d - 1 - A) // B - size + 1)
    if cnt > 0:
        ans = ans @ matrix_power(T, cnt)

    size += cnt
    if size >= L:
        break

print(ans[0])

### FIXED CODE ###

from numpy.linalg import matrix_power
from numpy import dot

class mint:
    def __init__(self, n):
        self.n = n % mod

    def __add__(self, other):
        return mint(self.n + other.n)

    def __mul__(self, other):
        return mint(self.n * other.n)

    def __repr__(self):
        return str(self.n)


L, A, B, mod = map(int, input().split())

ans = [mint(0), mint(A), mint(B)]

size = 0
for d in range(1, 19):
    x = pow(10, d, mod)
    T = [
        [mint(x), mint(0), mint(0)],
        [mint(1), mint(1), mint(0)],
        [mint(0), mint(1), mint(1)],
    ]

    cnt = min(L - size, max(0, 10 ** d - 1 - A) // B - size + 1)
    if cnt > 0:
        ans = dot(ans, matrix_power(T, cnt))

    size += cnt
    if size >= L:
        break

print(ans[0])
n = int(input())
a = list(map(int, input().split()))
a.sort()
data = [0 for _ in range(200001)]
for x in a:
    data[x] += 1

ans = 0
for i in range(1,200001):
    if not data[i]:continue
    if data[i] == 1:ans += 1
    j = i
    while j < 200001:
        data[j] = 0
        j += i

print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort()
data = [0 for _ in range(1000001)]
for x in a:
    data[x] += 1

ans = 0
for i in range(1,1000001):
    if not data[i]:continue
    if data[i] == 1:ans += 1
    j = i
    while j < 1000001:
        data[j] = 0
        j += i

print(ans)
import math
s = str(input())
m = (len(s) - 1) / 2
c = True
for i in range(math.floor(m / 2)):
    if s[i] != s[int(m-1-i)]:
        c = False
for i in range(math.floor(m / 2)):
    if s[int(m+1+i)] != s[int(len(s)-1-i)]:
        c = False
for i in range(math.floor(m)):
    if s[i] != s[int(math.floor(len(s)-i))]:
        c = False
if c:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import math
s = str(input())
m = (len(s) - 1) / 2
c = True
for i in range(math.floor(m / 2)):
    if s[i] != s[int(m-1-i)]:
        c = False
for i in range(math.floor(m / 2)):
    if s[int(m+1+i)] != s[int(len(s)-1-i)]:
        c = False
for i in range(math.floor(m)):
    if s[i] != s[int(math.floor(len(s)-1-i))]:
        c = False
if c:
    print("Yes")
else:
    print("No")
a = int(input())
b = int(input())
c = int(input())
if a == b and b== c:
 print("1")
elif a == b:
 print("2")
elif b == c:
 print("2")
elif a==c:
 print("2")
else:
 print("3")

### FIXED CODE ###

j = input().split()
a = int(j[2])
b = int(j[1])
c = int(j[0])
if a == b and b== c:
 print("1")
elif a == b:
 print("2")
elif b == c:
 print("2")
elif a==c:
 print("2")
else:
 print("3")
N = int(input())

arr = [i+1 for i in range(N)]

print((arr[0]+arr[-2])*(N-1)//2)

### FIXED CODE ###

N = int(input())

if N == 1:
    print(0)
else:
    print((1+(N-1))*(N-1)//2)
from math import ceil
from heapq import heapify, heappop, heappush

N, K, *A = map(int, open(0).read().split())

t = sum(A) / K
a = [None] * len(A)
for i in A:
    k = max(ceil(i / t), 1)
    a.append((-i / k, i, k))

heapify(a)
for _ in range(K):
    i, j, k = heappop(a)
    k += 1
    i = -(j / k)
    heappush(a, (i, j, k))
print(ceil(heappop(a)[0] * -1))


### FIXED CODE ###

from math import ceil

N, K, *A = map(int, open(0).read().split())

def is_ok(n):
    t = 0
    for a in A:
        if a <= n:
            continue
        t += ceil(a / n) - 1
    return t <= K

ok = 1000000000
ng = 0.0000000001
while abs(ng - ok) > 1:
    m = (ok + ng) // 2
    if is_ok(m):
        ok = m
    else:
        ng = m

print(ceil(ok))
s = input()
k = int(input())
for i in range(len(s)):
  if s[i] != '1':
    index = i
    break
if k-1 < i:
  print(1)
else:
  print(s[index])

### FIXED CODE ###

s = input()
k = int(input())

index = 0
for i in range(len(s)):
  if s[i] != '1':
    index = i
    break
if k-1 < index:
  print('1')
else:
  print(s[index])
X, N = map(int, input().split())
if N == 0:
    print(X)
    exit()

P = list(map(int, input().split()))
minmin = []
minn = 101
for i in range(1, 101):
    abs1 = abs(i - X)
    if not i in P and minn > abs1:
        minn = abs1
        minmin.append(i)

print(max(minmin))


### FIXED CODE ###

X, N = map(int, input().split())
if N == 0:
    print(X)
    exit()

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

for i in range(101):
    p = X - i not in P
    p1 = X + i not in P
    if p1 or p:
        if p:
            print(X - i)
            exit()
        print(X + i)
        exit()
import sys

def main():
    def input():
        return sys.stdin.readline()[:-1]

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

    p = list(map(int,input().split()))
    p = [p[k]-1 for k in range(N)]
    parent = [k for k in range(N)]

    def find(x):
        if parent[x] == x:
            return x
        else:
            return find(parent[x])

    def unite(x,y):
        if find(x) != find(y):
            parent[find(x)] = find(y)

    for k in range(M):
        x, y = map(int,input().split())
        unite(x-1,y-1)

    ans = 0
    for k in range(N):
        if find(k) == find(p[k]):
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(100010)

def main():
    def input():
        return sys.stdin.readline()[:-1]

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

    p = list(map(lambda x: int(x)-1, input().split()))
    parent = [k for k in range(N)]

    def find(x):
        if parent[x] == x:
            return x
        else:
            parent[x] = find(parent[x])
            return find(parent[x])

    def unite(x,y):
        parent[find(x)] = find(y)

    for k in range(M):
        x, y = map(int,input().split())
        unite(x-1,y-1)

    ans = 0
    for k in range(N):
        if find(k) == find(p[k]):
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()
s=input()
dp=[[-1 for _ in range(4)] for _ in range(len(s)+1)]
dp[len(s)][3]=1
for i in range(len(s),-1,-1):
    for j in range(3,-1,-1):
        if j<3:
            dp[len(s)][j]=0
        if i<len(s):
            dp[i][3]=3*dp[i+1][3] if s[i]=='?' else dp[i+1][3]
        if i<len(s) and j<3:
            m1=3 if s[i]=='?' else 1
            m2=1 if s[i]=='?' or s[i]==list('ABC')[j] else 0
            dp[i][j]=m1*dp[i+1][j]+m2*dp[i+1][j+1]
print(int(dp[0][0]%(1e9+7)))

### FIXED CODE ###

s=input()
dp=[[-1 for _ in range(4)] for _ in range(len(s)+1)]
dp[len(s)][3]=1
for i in range(len(s),-1,-1):
    for j in range(3,-1,-1):
        if j<3:
            dp[len(s)][j]=0
        if i<len(s):
            dp[i][3]=3*dp[i+1][3] if s[i]=='?' else dp[i+1][3]
            dp[i][3]%=1e9+7
        if i<len(s) and j<3:
            m1=3 if s[i]=='?' else 1
            m2=1 if s[i]=='?' or s[i]==list('ABC')[j] else 0
            dp[i][j]=m1*dp[i+1][j]+m2*dp[i+1][j+1]
            dp[i][j]%=1e9+7
print(int(dp[0][0]))
import math
r=double(input())
print('{0:.5f} {1:.5f}'.format(math.pi*r*r,math.pi*r*2))

### FIXED CODE ###

import math
r=float(input())
print('{0:.5f} {1:.5f}'.format(math.pi*r*r,math.pi*r*2))
N = int(input())
A, B = map(int,input.split())
if(A<=B/K*K){
  print("OK")
}
else{
  print("NG")
}

### FIXED CODE ###

N = int(input())
A, B = map(int, input().split())
for i in range(A, B+1):
  if i % N == 0:
    print('OK')
    break
else:
  print('NG')
import sys
n,m=map(int,input().split())
tmp=[-1]*n
for _ in range(m):
    s,c=map(int,input().split())
    s-=1
    if tmp[s]<0:
        tmp[s]=c
    if tmp[s]!=c:
        print(-1)
        sys.exit()
if tmp[0]==0 n>1:
    print(-1)
    sys.exit()
if tmp[0]<0 and n>1:
    tmp[0]=1
if n==1 and tmp[0]==-1:
    tmp[0]=0
for i in range(1,n):
    if tmp[i]<0:
        tmp[i]=0
t=''.join(tmp)
print(t)

### FIXED CODE ###

import sys
n,m=map(int,input().split())
tmp=[-1]*n
for _ in range(m):
    s,c=map(int,input().split())
    s-=1
    if tmp[s]<0:
        tmp[s]=c
    if tmp[s]!=c:
        print(-1)
        sys.exit()
if tmp[0]==0 and n>1:
    print(-1)
    sys.exit()
if tmp[0]<0 and n>1:
    tmp[0]=1
if n==1 and tmp[0]==-1:
    tmp[0]=0
for i in range(1,n):
    if tmp[i]<0:
        tmp[i]=0
for i in tmp:
    print(i,end='')
A,B,C = map(int, input().split())
if A=B!=C:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

A,B,C = map(int, input().split())
if A==B==C:
  print('No')
elif A==B or B==C or C==A:
  print('Yes')
else:
  print('No')
N,K=map(int,input().split())
R,S,P=map(int,input().split())
T=str(input())

rec=[]
ans=0

def win(hand):
    if hand=='r':
        return ['p',P]
    elif hand=='s':
        return ['r',R]
    else:
        return ['s',S]

def gap(hand):
    if hand=='r':
        return 's'
    elif hand=='s':
        return 'p'
    else:
        return 'r'


for i in range(N):
    win_hand=win(T[i])[0]
    win_point=win(T[i])[1]
    same_hand=T[i]
    if 0<=i<=K-1:
        rec.append(win_hand)
        ans+=win_point
    else:
        if win_hand!=rec[i-K]:
            rec.append(win_hand)
            ans+=win_point
        else:
            if N-K<i<=N-1:
                rec.append(same_hand)#不要
            else:
                next_win_hand=win(T[i+K])[0]
                rec.append(gap(next_win_hand))

    #print(ans)

#print(rec)
print(ans)




### FIXED CODE ###

N,K=map(int,input().split())
R,S,P=map(int,input().split())
T=str(input())

rec=[]
ans=0

def win(hand):
    if hand=='r':
        return ['p',P]
    elif hand=='s':
        return ['r',R]
    else:
        return ['s',S]

def gap(hand):
    if hand=='r':
        return 's'
    elif hand=='s':
        return 'p'
    else:
        return 'r'


for i in range(N):
    win_hand=win(T[i])[0]
    win_point=win(T[i])[1]
    same_hand=T[i]
    if 0<=i<=K-1:
        rec.append(win_hand)
        ans+=win_point
    else:
        if win_hand!=rec[i-K]:
            rec.append(win_hand)
            ans+=win_point
        else:
            if N-K-1<i<=N-1:
                rec.append(same_hand)#不要
            else:
                next_win_hand=win(T[i+K])[0]
                rec.append(gap(next_win_hand))

    #print(ans)

#print(rec)
print(ans)
N, K = map(int, input().split())

r = 0
def func(n):
	c, t = 0, n
	while t <= K:
		t <<= 1
		c += 1
	#return (1 / 2) ** c
	return c
"""
for n in range(N):
	#r += [func(n)]
	r += 2 ** n
	#print(r)
"""

base = func(1)

r = int("1" * (base - 1), 2)
#print(r)

print(r * ((1 / 2) ** base) / N)


### FIXED CODE ###

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

r = 0
for n in range(1, N + 1):
	c, t = 0, n
	while t < K:
		t *= 2
		c += 1
	r += (1 / N) * (1 / 2) ** c
print(r)
x = list(input().split())
s = x[0]*x[1]
l = 2*(x[0]+x[1])
print(s, l)

### FIXED CODE ###

x = input().split(" ")
a = int(x[0])
b = int(x[1])
s = a*b
l = 2*(a+b)
print(s, l)
a,b,c = map(int,input().split())
from decimal import *

roota = Decimal(a) ** Decimal(0.5)
rootb = Decimal(b) ** Decimal(0.5)
rootc = Decimal(c) ** Decimal(0.5)
n = 24
root_a = Decimal(str(roota)).quantize(Decimal(str(10**(n*-1))), rounding=ROUND_DOWN)
root_b = Decimal(str(rootb)).quantize(Decimal(str(10**(n*-1))), rounding=ROUND_DOWN)
root_c = Decimal(str(rootc)).quantize(Decimal(str(10**(n*-1))), rounding=ROUND_DOWN)

if root_a + root_b < root_c:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import decimal
a,b,c = map(decimal.Decimal,input().split())
roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")
n,_=input().split();s={*input()};n=int(n);print(n+[len(s&set(str(b)))for b in range(n,99999)].index(0))

### FIXED CODE ###

s=set(range(10))
n,k,*a=map(int,open(0).read().split())
a=s-set(a) #使っていい数字
for t in range(n,100000):
    if set(list(map(int,list(str(t)))))<=a:
        print(t)
        break
n,x=map(int,input().split())

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

ans=0
d=0

for i in range(n+1):
    d+=l[i]
    ans+=1
    if(d>x):
        break
        
print(ans)

### FIXED CODE ###

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

ans=0
d=0

for i in range(n):
    d+=l[i]
    if(d<=x):
        ans+=1
        
print(ans+1)
import sys
input = sys.stdin.readline

num = int(input())
an = list(map(int, input().split()))

ans = 0

for i in range(len(an)):
  for j in range(len(an)):
    if i < j:
      kake = an[i] * an[j]
      kake %= ((10 ** 9) + 7)
      ans += kake
  
ans %= ((10 ** 9) + 7)

print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

d, t, s = map(int, input().split())

run = t * s
if d <= run:
  print("Yes")
else:
  print("No")
N = int(input())

a_b_lis = [0] * N

for i in range(N):
    a_b_lis[i] = list(map(int, input().split()))

count = 0
a_b_lis = sorted(a_b_lis, key=lambda x: x[1], x[0])

on_time = True
for item in a_b_lis:
    if item[0] + count <= item[1]:
        count += item[0]
        on_time = True
    else:
        on_time = False

if on_time:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = int(input())

a_b_lis = [0] * N

for i in range(N):
    a_b_lis[i] = list(map(int, input().split()))

count = 0
#print(a_b_lis)
a_b_lis = sorted(a_b_lis, key=lambda x: x[1])

on_time = True
for item in a_b_lis:
    count += item[0]
    if count > item[1]:
        on_time = False
if on_time:
    print('Yes')
else:
    print('No')
from bisect import bisect_left,bisect_right
p=10**9+7
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
pi=1
ni=1
ans=1
for _ in range(k//2):
  if a[ni]*a[ni+1]>a[-pi]*a[-pi-1]:
    ans=ans*a[ni]*a[ni+1]%p
    ni+=2
  else:
    ans=ans*a[-pi]*a[-pi-1]%p
    pi+=2
if k%2==1:
  ans=ans*a[-pi]%p
print(ans)

### FIXED CODE ###

from bisect import bisect_left,bisect_right
p=10**9+7
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
pi=1
ni=0
ans=1
i=0
while i<k-1:
  if a[ni]*a[ni+1]>a[-pi]*a[-pi-1]:
    ans=ans*a[ni]*a[ni+1]%p
    ni+=2
    i+=2
  else:
    ans=ans*a[-pi]%p
    pi+=1
    i+=1
if i==k-1:
  ans=ans*a[-pi]%p
if a[-1]<0 and k%2==1:
  ans=1
  for i in a[n-k:]:
    ans=ans*i%p
print(ans)
def checkFunction(c):
    
    if (not 'WR' in c):
        return 0
    while True:
        if c[0] == 'R':
            c = c[1:]
        else:
            break
    while True:
        if c[-1] == 'W':
            c = c[:-1]
        else:
            break

    if c.index('R') + 1 != len(c):
        c2 = c.replace('WR', 'RR',1)[:-1]
        return checkFunction(c2) + 1
    return 1


N = int(input())
c= input()

print(checkFunction(c))



### FIXED CODE ###


def check(N, c):
    RinRight = c.count('R')
    WinLeft = 0
    r = RinRight
    for i in range(N):
        if c[i] == 'R':
            RinRight -= 1
        else: # c[i] == 'W'
            WinLeft +=1
        r = min(r, max(RinRight,WinLeft))

    return r


N = int(input())
c= input()
print(check(N,c))
N = int(input())
mydict = []
for i in range(N):
  a, b=input().split()
  mydict.append([str(a), int(b)])
mydict.sort()
print(mydict[0], mydict[1])

### FIXED CODE ###

N = int(input())
mydict = []
for i in range(1, N+1):
  a, b=input().split()
  mydict.append([str(a), int(b), i])
mydict = sorted(mydict, key=lambda x:x[1], reverse=True)
mydict = sorted(mydict, key=lambda x:x[0])
for i in mydict:
  print(i[2])
A,B=input().split()

if float(A)==int(float(A)):
  A = int(A)
else:
  A = float(A)
  
if float(B)==int(float(B)):
  B = int(B)
else:
  B = float(B)
    
print(int(A*B))

### FIXED CODE ###

A,B=input().split()
A = int(A)
B = int(float(B)*100+.5)
print(A*B//100)
import sys

def dec_num(x):
    for i in range(len(x)):
        if x[i] == 2:
            x[i] = 5
        elif x[i] == 3:
            x[i] = 10
        elif x[i] == 4:
            x[i] = 50
        elif x[i] == 5:
            x[i] = 100
        elif x[i] == 6:
            x[i] = 500
        elif x[i] == 7:
            x[i] = 1000

def to_index(x):
    if x == 1:
        return 1
    elif x == 5:
        return 2
    elif x == 10:
        return 3
    elif x == 50:
        return 4
    elif x == 100:
        return 5
    elif x == 500:
        return 6
    elif x == 1000:
        return 7


def toNum(x):
    result = 0
    tmp = x[0]
    for i in range(len(x)):
        if tmp < x[i]:
            result += x[i]-tmp
        elif i <= len(x) and x[i] < x[i+1]:
            result += 0
        else:
            result += x[i]
        tmp = x[i] 

    return result

for line in sys.stdin.readlines():
    line = line.translate(str.maketrans('IVXLCDM', '1234567'))
    num = list(map(int, (' '.join(line)).split()))
    dec_num(num)
    print(toNum(num))

### FIXED CODE ###

import sys

def dec_num(x):
    for i in range(len(x)):
        if x[i] == 2:
            x[i] = 5
        elif x[i] == 3:
            x[i] = 10
        elif x[i] == 4:
            x[i] = 50
        elif x[i] == 5:
            x[i] = 100
        elif x[i] == 6:
            x[i] = 500
        elif x[i] == 7:
            x[i] = 1000

def to_index(x):
    if x == 1:
        return 1
    elif x == 5:
        return 2
    elif x == 10:
        return 3
    elif x == 50:
        return 4
    elif x == 100:
        return 5
    elif x == 500:
        return 6
    elif x == 1000:
        return 7


def toNum(x):
    result = 0
    tmp = x[0]
    for i in range(len(x)):
        if tmp < x[i]:
            result += x[i]-tmp
        elif i < len(x)-1 and x[i] < x[i+1]:
            result += 0
        else:
            result += x[i]
        tmp = x[i] 

    return result

for line in sys.stdin.readlines():
    line = line.translate(str.maketrans('IVXLCDM', '1234567'))
    num = list(map(int, (' '.join(line)).split()))
    dec_num(num)
    print(toNum(num))
from collections import deque

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

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

dist=[-1 for i in range(n)]
dist[0]=0

dq=deque()
dq.append(0)

while dq:
  x=dq.popleft()

  if x==n-1:
    if dist[x]==2:
      print('POSSIBLE')
    else:
      print('IMPOSSIBLE')

  for i in tree[x]:
    if dist[i]==-1:
      dist[i]=dist[x]+1
      dq.append(i)

### FIXED CODE ###

s=input()
sl=len(s)

if sl==1:
  print(int(s))
  exit()

ans=0
for i in range(2**(sl-1)):
  l=['' for j in range(sl-1)]
  for k in range(sl-1):
    if (i>>k)&1:
      l[k]='+'

  t_ans=0
  t_s=s[0]

  for k in range(1,sl):
    if l[k-1]=='+':
      t_ans+=int(t_s)
      t_s=s[k]
    else:
      t_s+=s[k]

    if k==sl-1:
      t_ans+=int(t_s)

  ans+=t_ans

print(ans)
a = input()

if a < 1200:
    print("ABC")
elif(a < 2800)
    print("ARC")
else
    print("AGC")


### FIXED CODE ###

a = int(input())

if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")
from bisect import bisect_right as br
n,k=map(int,input().split())
b=[0]*(n+1)
def f(x):
    c=0
    while x>0:
        c+=b[x]
        x-=x&-x
    return c
def g(x,a):
    while x<n+1:
        b[x]+=a
        x+=x&-x
for i in range(n):
    g(i+1,int(input())-k)
c=[0]
d=0
for i in range(1,n+1):
    t=f(i)
    k=br(c,t)
    c.insert(k,f(i))
    d+=i-k
print((n*(n+1))//2-d)

### FIXED CODE ###

n=int(input())
a=[int(input())for i in range(n)]
a.sort()
c=0
p=sum(a)
if p%10!=0:
    print(p)
else:
    for i in range(n):
        if a[i]%10!=0:
            break
        else:
            c+=1
    print(0 if c==n else p-a[i])
def main():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort()
    ans = 0
    temp = 0
    for i in range(N):
        if i == 0 and A[i+1] != A[i]:
            ans += 1
            continue

        temp = A[i]

        if i == N-1 and temp == A[i-1]:
            continue
        elif i != N-1:
            if temp == A[i+1] or temp == A[i-1]:
                continue

        for j in range(N):
            if A[j] <= temp/2 and A[i]%A[j] == 0:
                break
            elif A[j] <= temp//2 and A[i]%A[j] != 0:
                continue
            elif A[j] > temp//2:
                ans += 1
                break
    return ans

print(main())


### FIXED CODE ###

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

    A.sort()
    dict = {}
    for i in range(1,A[N-1]+1):
        dict[i] = 0

    if N == 1:
        return 1

    if A[0] == 1 and A[1] != 1:
        return 1
    elif A[0] == 1 and A[1] == 1:
        return 0

    temp = 1

    for num in A:
        while True:
            if num*temp <= A[N-1]:
                dict[num*temp] += 1
                temp += 1
            else:
                temp = 1
                break

    ans = 0
    for num2 in A:
        if dict[num2] <= 1:
            ans += 1

    return ans


print(main())
n=int(input())
x={0:'S',1:'H',2:'C',3:'D'}
c=[[0]*13,[0]*13,[0]*13,[0]*13]
for i in range(n):
    a,b=input().split()
    if a=='S':
        c[0].insert(b,b)
    elif a=='H':
        c[1].insert(b,b)
    elif a=='C':
        c[2].insert(b,b)
    else:
        c[3].insert(b,b)
for i in range(4):
    for j in range(13):
        if c[i][j]==0:
            print(x[i],j)


### FIXED CODE ###

n=int(input())
x={0:'S',1:'H',2:'C',3:'D'}
c=[[0]*13,[0]*13,[0]*13,[0]*13]
for r in range(n):
    a,b=input().split()
    b=int(b)-1
    if a=='S':
        c[0][b]=1
    elif a=='H':
        c[1][b]=1
    elif a=='C':
        c[2][b]=1
    else:
        c[3][b]=1
for i in range(4):
    for j in range(13):
        if c[i][j]==0:
            print(x[i],j+1)
K=int(input())
S= input()

if len(T) < K :
    print(S)

else:
    print (S[0:K]+'...')

### FIXED CODE ###

# Take both input K & S, then compare the length of S with K and assign it to length
# If the length is <= K print all
# And if length is >K print some of the character

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

x = 0

length = len(S)

if length <= K:
    print(S)
else:
    while x < K:
        print(S[x], end=(""))
        x += 1
    print("...")
import sys
n,m = map(int, sys.stdin.readline().rstrip("\n").split())
cage = {}
for i in range (2,n+1):
    cage[i] = None
ab = [map(int, line.rstrip("\n").split()) for line in sys.stdin]
a,b = [list(i) for i in zip(*ab)]
room = [1]
nroom = []
while None in cage.values():
    for i in range(len(room)):
        j = 0
        while j < (len(a)):
            if a[j] == room[i]:
                if cage[b[j]] == None:
                    cage[b[j]] = a[j]
                nroom.append(b[j])
                a.pop(j)
                b.pop(j)
                j += 1
            elif b[j] == room[i]:
                if cage[a[j]] == None:
                    cage[a[j]] = b[j]
                nroom.append(a[j])
                a.pop(j)
                b.pop(j)
                j += 1
            else:
                j += 1
    room = nroom
    if len(a) == 0 and None in cage.values():
        print('No')
        break
else:
    print('Yes')
    for i in range (2,n+1):
        print(cage[i])

### FIXED CODE ###

import sys
import queue
n,m = map(int, sys.stdin.readline().rstrip("\n").split())
adj = [[]for i in range(n+1)]
parent = [-1] * (n+1)
for line in sys.stdin:
    a,b = map(int, line.rstrip("\n").split())
    adj[a].append(b)
    adj[b].append(a)
q = queue.Queue()
q.put((1,0))
while(not q.empty()):
    x, p = q.get()
    if parent[x] != -1: # 訪問済み
        continue
    parent[x] = p
    for next in adj[x]:
        if parent[next] == -1: # 未訪問なら
            q.put((next,x))
print ('Yes') # 必ず目標は達成できる
for p in parent[2:]: # 部屋2以降の親（前の部屋）
    print(p)
for i in range(int(input())):
    a = sorted(map(int,input().split()),reversed = True)
    if a[0]**2 == a[1]**2 + a[2]**2:
        print("YES")
    else:
        print("NO")
    

### FIXED CODE ###

for i in range(int(input())):
    a = sorted(map(int,input().split()),reverse = True)
    if a[0]**2 == a[1]**2 + a[2]**2:
        print("YES")
    else:
        print("NO")
x = raw_input()
print x ** 3


### FIXED CODE ###

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