Harryxun/stf_run huggingface dataset:
import math
n=int(input())
sqn=math.sqrt(n)
ch=n-sqn
nums=[]
su=0
stage=2
while(su<n):
    n_ = math.ceil(n*(stage-1)/stage)
    if n_ == su:
        nums.append(1)
        nums.append(n-su-1)
        break
    nums.append(n_-su)
    su+=n_-su
    if su>=ch:
        nums.append(n-su)
        break
    stage += 1
ans=[]
next_div_num = 0
k=len(nums)
for i in range(k):
    next_div_num += nums[k-1-i]
    if nums[k-1-i] == 1:
        continue
    sho = n//next_div_num
    d = next_div_num-1
    if d==0 or sho>d:
        continue
    if sho == n%d:
        ans.append(d)
print(sum(ans))

### FIXED CODE ###

import math
n=int(input())
sqn=math.sqrt(n)
ch=n-sqn
nums=[]
su=0
stage=2
if n==1:
    print(0)
else:
    while(su<n):
        n_ = math.ceil(n*(stage-1)/stage)
        if n_ == su:
            nums.append(1)
            nums.append(n-su-1)
            break
        nums.append(n_-su)
        su+=n_-su
        if su>=ch:
            nums.append(n-su)
            break
        stage += 1
    ans=[]
    next_div_num = 0
    k=len(nums)
    for i in range(k):
        next_div_num += nums[k-1-i]
        if nums[k-1-i] == 1:
            continue
        sho = n//next_div_num
        d = next_div_num
        if d==0 or sho>d:
            continue
        if sho == n%d:
            ans.append(d)
        elif sho>n%d:
            d-=1
            if d==0 or sho>d:
               continue
            if sho == n%d:
                ans.append(d)
    print(sum(ans))
print("H" if input()==input() else "D")

### FIXED CODE ###

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

if a==b:
	print ("H")
else:
  	print("D")
# import
import numpy as np
import sys
sys.setrecursionlimit(10**6)

# input
H, W = map(int, input().split())

Mtmp = []
for _ in range(H):
    tmp = list(input())
    Mtmp.append(tmp)

M = np.array(Mtmp)
S = np.array([[0]*W]*H)

#print(M)

digtmp = np.array([[0, 1], [1, 0], [0, -1], [-1, 0]])

def dfs(i, j):
    global ngflag
    global searchflag
    if S[i, j] == 1:
        return
    S[i, j] = 1
    if M[i, j] == '.':
        return
    #print("i:{}, j:{}".format(i, j))
    searchflag = 1
    dig = digtmp + np.array([i, j])
    for d in dig:
        if 0 <= d[0] < H and 0 <= d[1] < W:
            if M[d[0], d[1]] == '#':
                ngflag = 0
                dfs(d[0], d[1])

searchflag = 0
ngflag = 1

while True:
    if 0 not in S:
        if M[target[0], target[1]] == '.':
            ngflag = 0
        break
    target = list(zip(*np.where(S == 0)))[0]
    #print("sf:{}, ng:{}".format(searchflag, ngflag))
    if M[target[0], target[1]] == '#':
        ngflag = 1
    dfs(target[0], target[1])
    if M[target[0], target[1]] == '#' and searchflag == 1 and ngflag == 1:
        break


#print("sf:{}, ng:{}".format(searchflag, ngflag))

if searchflag == 1 and ngflag == 0:
    ans = 'Yes'
elif searchflag == 1 and ngflag == 1:
    ans = 'No'
else:
    ans = 'Yes'

print(ans)


### FIXED CODE ###


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

if a <= b:
    ans = a
else:
    ans = a-1

print(ans)
import math
x = map(float,raw_input().split(' '))
print math.pow((x[0] - x[2])**2 + (x[1] - x[3])**2)

### FIXED CODE ###

x = map(float,raw_input().split(' '))
import turtle
kame = turtle.Turtle()
kame.speed(0)
kame.goto(x[2],x[3])
print kame.distance(x[0],x[1])
# -*- coding: utf-8 -*-
x, n = map(int, input().split())
ps = list(map(int, input().split()))

for i in range(0, x):
    for j in [-1, 1]:
        temp = x + (i*j)
        if ps.count(temp) == 0:
            ans = temp
            break


print(ans)


### FIXED CODE ###

x, n = map(int, input().split())
ps = list(map(int, input().split()))
pss = [i for i in range(-1000, 1000)]
ps = list(filter(lambda i: i not in ps, pss))
ans = x

for i, p in enumerate(ps):
    temp = abs(x-p)
    if i == 0:
        mins = temp
        ans = p
    else:
        if mins > temp:
            mins = temp
            ans = p
        elif mins == temp:
            if ans > p:
                ans = p

print(ans)
N = int(input())
P = [int(input()) for i in range(N)]

T = [1] * N
L = []
for i in P:
  for j in L:
    if T[j] + j == i:
      T[j] += 1
      break
  else:
    L.append(i)

print(N - max(T))

### FIXED CODE ###

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

T = [0] * (N + 1)
for i in P:
  if T[i - 1] == 0:
    T[i] = -1
  elif T[i - 1] < 0:
    T[i - 1] -= 1
    T[i] = i - 1
  else:
    T[T[i - 1]] -= 1
    T[i] = T[i - 1]

print(N + min(T))
x,y = input()
if x == y:
  print("Yes")
else:
  print("No")
 

### FIXED CODE ###

x,y = input().split()
if x == y:
  print("Yes")
else:
  print("No")
s = list(input())
t = list(input())

l = []

for i in range(len(s)-len(t) + 1):
    f = True
    for j in range(len(t)):
        if s[i+j] != '?' and s[i+j] != t[j]:
            f = False
            break
    if f:
        a = s[:i] + t + s[i+len(t):]
        l.append(a.replace('?','a'))
if len(l)>0:
    print(min(l))
else:
    print('UNRESTORABLE')


### FIXED CODE ###

s = input()
t = input()

l = []

for i in range(len(s)-len(t) + 1):
    f = True
    for j in range(len(t)):
        if s[i+j] != '?' and s[i+j] != t[j]:
            f = False
            break
    if f:
        a = s[:i] + t + s[i+len(t):]
        l.append(a.replace('?','a'))
if len(l)>0:
    print(min(l))
else:
    print('UNRESTORABLE')
N,D= map(int, input().split())
x,y=[int(input()) for i in range(N)]
s=0
def distance_count():
  for i in range(N)
      if (x[i]**2 + y[i]**2)**(1/2)<= D :
          s=s+1
    return s
answer = distance_count(x,y)
print(answer)

### FIXED CODE ###

N,D = map(int, input().split())
XY = [map(int, input().split()) for _ in range(N)]
X,Y = [list(i) for i in zip(*XY)]

s=0
for i in range (N):
  if X[i]*X[i]+Y[i]*Y[i]<=D*D:
    s=s+1
print(s)
a = raw_input()
b = raw_input()
print a*b
print 2(a+b)

### FIXED CODE ###

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

print a*b, 2*(a+b)
N,K = [int(i) for i in input().split()]

print(K * (K-1) ** (N-1))


### FIXED CODE ###

a,b,c = [int(i) for i in input().split()]
n = 3
if a == b and a == c:
    print(1)
else:
    if a == b:
        n = n-1
    elif b == c:
        n = n-1
    elif a == c:
        n = n-1
    print(n)
import collections
h,w = map(int,input().split())
s=[list(input()) for _ in range(h)]
deq = collections.deque([[0,0,0]])

while deq:
    i,j,k = deq.popleft()
    if not((i in range(h)) and (j in range(w))):
        continue
    if s[i][j] != '.':
        continue
    s[i][j]=k
    if i==h-1 and j == w-1:
        break
    deq.append([i + 1, j, k + 1])
    deq.append([i - 1, j, k + 1])
    deq.append([i, j + 1, k + 1])
    deq.append([i, j - 1, k + 1])
if s[i][j] =='.':
    print(-1)
else:
    black = sum([y.count('#') for y in s])
    print(h*w-black-s[h-1][w-1]-1)

### FIXED CODE ###

import collections
h,w = map(int,input().split())
s=[list(input()) for _ in range(h)]
deq = collections.deque([[0,0,0]])

while deq:
    i,j,k = deq.popleft()
    if not((i in range(h)) and (j in range(w))):
        continue
    if s[i][j] != '.':
        continue
    s[i][j]=k
    if i==h-1 and j == w-1:
        break
    deq.append([i + 1, j, k + 1])
    deq.append([i - 1, j, k + 1])
    deq.append([i, j + 1, k + 1])
    deq.append([i, j - 1, k + 1])
if s[h-1][w-1] == '#'or s[h-1][w-1] =='.':
    print(-1)
else:
    black = sum([y.count('#') for y in s])
    print(h*w-black-s[h-1][w-1]-1)
s=list(input())
s2=""
for i in range(len(s)):
  if i%==2:
    s2+=a[i]
print(s2)

### FIXED CODE ###

s=list(input())
s2=''
for i in range(len(s)):
  if i%2==0:
    s2+=s[i]
print(s2)
import numpy as np

def LI():
  return [int(s) for s in input().split()]

N,K,Q = LI()
A_s = np.array([K]*N)

for i in range(Q):
  seikai = int(input())
  for j in range(N):
    if j != (seikai-1):
      A_s[j]-=1
      
for i in range(N):
  if A_s[i] > 0:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

import numpy as np
 
def LI():
  return [int(s) for s in input().split()]
 
N,K,Q = LI()
Seikai_s = np.array([Q]*N)
 
for i in range(Q):
  seikai = int(input())
  Seikai_s[seikai-1]-=1
      
for i in range(N):
  if K-Seikai_s[i] > 0:
    print('Yes')
  else:
    print('No')
h = int(input())
mem = [0] * 100
cnt = 0
 
def atk(k):
    if k == 1:
        mem[1] = 1
        return 1
    else:
        j = int(k // 2)
        l = 0
        while k / ( 2 ** l) >1:
            l += 1
 
        if mem[l] == 0:
            mem[l] = atk(j) * 2 + 1
            return mem[l]
        else:        
            return mem[l]

atk(h)
mem.sort(reverse = True)
print(mem[0])


### FIXED CODE ###

n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort(reverse = True)

if k > n:
  k = n

for i in range(k):
  h[i] = 0

ans = 0
for i in range(n):
  ans += h[i]
  
print(ans)
import math

n=int(input())

def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

e=get_sieve_of_eratosthenes(n)
l=len(e)

co=1
for i in range(l):
    k=e[i]
    co_sub=1
    l_sub=int(math.log(n,k))
    for j in range(1,l_sub+1):
        co_sub+=n//(k**j)
    co*=co_sub
    co%=(10**9+7)
    #print(co_sub)
print(co)


### FIXED CODE ###

import math

n=int(input())

def get_sieve_of_eratosthenes(n):
    if n==1:
        return []
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

e=get_sieve_of_eratosthenes(n)
l=len(e)

co=1
for i in range(l):
    k=e[i]
    co_sub=1
    l_sub=int(math.log(n,k))
    for j in range(1,l_sub+1):
        co_sub+=n//(k**j)
    co*=co_sub
    co%=(10**9+7)
    #print(co_sub)
print(co)
from sys import stdin


def calc_cost(p, x):
    return (x - p)**2


def min_cost(n, data):
    cost = 1_000_000
    for p in range(1, 100 + 1):
        tmp_cost = sum([calc_cost(p, x) for x in data])
        if tmp_cost < cost:
            cost = tmp_cost
    return cost


def main():
    N = [int(x) for x in stdin.readline().rstrip()]
    CORP = [int(x) for x in stdin.readline().rstrip().split()]
    cost = min_cost(N, CORP)
    print(cost)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from sys import stdin


def calc_cost(p, x):
    return (x - p)**2


def min_cost(n, data):
    cost = 1000000
    for p in range(1, 100 + 1):
        tmp_cost = sum([calc_cost(p, x) for x in data])
        if tmp_cost < cost:
            cost = tmp_cost
    return cost


def main():
    N = [int(x) for x in stdin.readline().rstrip()]
    CORP = [int(x) for x in stdin.readline().rstrip().split()]
    cost = min_cost(N, CORP)
    print(cost)


if __name__ == "__main__":
    main()
n = int(input())

#[～][0] =>t [1]=>x [2]=>y
l = [list(map(int,input().split())) for i in range(n)]

judge = 'No'

#初期値
l.insert(0,[0,0,0])
for i in range(n):
    #奇数がT偶数がF
    dt = l[i+1][0]-l[i][0]
    n_j = dt%2
    xy = (l[i+1][1]+l[i+1][2])-(l[i][1]+l[i][2])
    if n_j==xy%2 and dt>=abs(xy):
        judge = 'Yes'
    else:
        judge ='No'
        break

print(judge)

### FIXED CODE ###


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

c = a*b

if c%2==1:
    print("Odd")
else:
    print("Even")
import math
from sys import stdin,stdout
#% 998244353
from heapq import heapify,heappop,heappush

import collections
# T = int(stdin.readline())
# for i in range(T):
    #N=int(stdin.readline())
N,M=list(map(int,stdin.readline().split()))
hill=list(map(int,stdin.readline().split()))

dc=collections.defaultdict(list)
#vis=set()
for m in range(M):
    A,B=list(map(int,stdin.readline().split()))
    dc[A].append(B)
    dc[B].append(A)

ans=0
for k,ls in dc.items():

    f=0
    for h in ls:
        if ls.count(h)>1:
            continue
        if hill[k-1]<hill[h-1]:
            f=1
            break
    if not f:
        ans+=1  

ans+=N-len(dc.keys())
print(ans)            

### FIXED CODE ###

import math
from sys import stdin,stdout
#% 998244353
T = stdin.readline()
T=T[:-1]
if T=="ABC":
    print("ARC")
elif T=="ARC":
    print("ABC")
#include<stdio.h>

int judge(int a, int b)
{
    if(a < b)
    {
        return 0;
    }
    else if(a >= b)
    {
        return 10;
    }
    else
    {
        return 2;
    }
}

int main()
{
    int a, b;
    scanf("%i %i", &a, &b);
    int re = judge(a, b);
    printf("%i\n", re);
}


### FIXED CODE ###

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

def f(a, b):
    if a < b:
        return 0
    elif a >= b:
        return 10

print(f(a, b))
num = int(input())
print(num + num * mum + num ** 3)

### FIXED CODE ###

num = int(input())

print(num + num ** 2 + num ** 3)
N = int(input())
A = [int(i) for i in input().split()]
num = 1
ans = 0
for j in range(N):
    num = num*A[j]
while num % 2 == 0:
    ans = ans + 1
    num = num / 2
print(ans)

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
num = 1
ans = 0
for j in range(N):
    while A[j] % 2 == 0:
        ans += 1
        A[j] /= 2
print(ans)
x = int(input())
y = int(input())

print(x*y)
print(2*x+2*y)



### FIXED CODE ###

x,y=map(int, input().split())
print(x*y,2*(x+y))
N = int(input())
v = list(map(int, input().split()))

v_sorted = sorted(v)

out = 0
for i in range(N-1):
  out += v_sorted[i]*(1/2)^(N-1-i)

print(out+v_sorted[-1]*(1/2))

### FIXED CODE ###

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

v_s = sorted(v)

out = 0
for i in range(N):
  if i == 0:
    out += v_s[i]*((1/2)**(N-1))
  else:
    out += v_s[i]*((1/2)**(N-i))
  
print(out)
dxy = [[1,0],[0,1],[-1,0],[0,-1],[1,1],[-1,1],[-1,-1],[1,-1]]
def solve(field,w,h):
	if 0 <= w < W and 0 <= h < H and field[h][w] == 1:
		field[h][w] = 0
		for dx,dy in dxy:
			solve(field,w+dx,h+dy)
		return 1
	else:
		return 0

while 1:
	W,H = map(int,raw_input().split())
	if W == 0: break
	field = [map(int,raw_input().split()) for i in range(H)]
	ans = 0
	for h in range(H):
		for w in range(W):
			if field[h][w] == 1:
				solve(field,w,h)
				ans += 1
	print ans

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

def dfs(x, y):
    C[y][x] = 0
    for dx,dy in zip([1,1,0,-1,-1,-1,0,1],[0,1,1,1,0,-1,-1,-1]):
        if 0 <= x+dx < w and 0 <= y+dy < h and C[y+dy][x+dx] == 1:
            dfs(x+dx, y+dy)

while 1:
    w,h = map(int,raw_input().split())
    if w == h == 0: break
    C = [map(int,raw_input().split()) for _ in xrange(h)]

    ans = 0
    for y in range(h):
        for x in range(w):
            if C[y][x] == 1:
                dfs(x, y)
                ans += 1
    print ans
a=input()

b=input()

print (a-1)*(b-1)

### FIXED CODE ###

n, m = map(int, input().split())
print((n-1) * (m-1))
S = list(input())
stlen = len(S) 
if len(S)%2 == 0:
    a = '10'*(stlen/2)
    b = '01'*(stlen/2)
    counta = countb = 0
    for i in range(stlen):
        if a[i] != S[i]:
            counta += 1
        if b[i] != S[i]:
            countb += 1
    print(min(counta,countb))
else:
    a = '10'*(int(stlen/2))+'1'
    b = '01'*int((stlen/2))+'0'
    counta = countb = 0
    for i in range(stlen):
        if a[i] != S[i]:
            counta += 1
        if b[i] != S[i]:
            countb += 1
    print(min(counta,countb))

### FIXED CODE ###

S = list(input())
stlen = len(S) 
if len(S)%2 == 0:
    a = '10'*(int(stlen/2))
    b = '01'*(int(stlen/2))
    counta = countb = 0
    for i in range(stlen):
        if a[i] != S[i]:
            counta += 1
        if b[i] != S[i]:
            countb += 1
    print(min(counta,countb))
else:
    a = '10'*(int(stlen/2))+'1'
    b = '01'*(int(stlen/2))+'0'
    counta = countb = 0
    for i in range(stlen):
        if a[i] != S[i]:
            counta += 1
        if b[i] != S[i]:
            countb += 1
    print(min(counta,countb))
S = input()
S_list = list(S)
answers = []
acgt = 0
for s in S_list:
    if s == 'A' or s == 'C' or s == 'G' or s == 'T':
        acgt += 1
    else:
        answers.append(acgt)
        acgt = 0
print(max(answers))

### FIXED CODE ###

S = input()
S_list = list(S)
answers = []
acgt = 0
for s in S_list:
    if s == 'A' or s == 'C' or s == 'G' or s == 'T':
        acgt += 1
    else:
        answers.append(acgt)
        acgt = 0
answers.append(acgt)
if answers:
    print(max(answers))
else:
    print(acgt)
a = int(input())
_ = int(input())
_ = int(input())
_ = int(input())
e = int(input())
k = int(input())

if e - a =< k:
  print("Yay!")
else:
  print(":(")



### FIXED CODE ###

a = int(input())
_ = int(input())
_ = int(input())
_ = int(input())
e = int(input())
k = int(input())

if e - a <= k:
  print("Yay!")
else:
  print(":(")
N = int(input())
A = list(map(int, input().split()))


def solve(i, s, k, sign):
    if i == N:
        return k

    if sign * (s + A[i]) > 0:
        return solve(i + 1, s + A[i], k, sign * -1)
    else:
        return solve(i + 1, sign, k + abs(s + A[i]) + 1, sign * -1)


a = solve(0, 0, 0, 1)
b = solve(0, 0, 0, -1)

print(a)


### FIXED CODE ###

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

ret = float('inf')

sign = 1
s = 0
k = 0
for a in A:
    if sign * (s + a) > 0:
        s += a
    else:
        k += abs(s + a) + 1
        s = sign
    sign *= -1
ret = min(ret, k)

sign = -1
s = 0
k = 0
for a in A:
    if sign * (s + a) > 0:
        s += a
    else:
        k += abs(s + a) + 1
        s = sign
    sign *= -1

ret = min(ret, k)


print(ret)
N = int(input())
X = input()

mod0 = X.count("1") + 1
mod1 = X.count("1") - 1

full0 = 0
full1 = 0
for i in range(N):
    full0 = (full0 + int(X[i]) * pow(2, N - i - 1, mod0)) % mod0
    full1 = (full1 + int(X[i]) * pow(2, N - i - 1, mod1)) % mod1

ans = [0] * N
for i in range(N):
    if X[i] == "0":
        cur = (full0 + pow(2, N - i - 1, mod0)) % mod0
    else:
        cur = (full1 + pow(2, N - i - 1, mod1)) % mod1

    res = 1
    while cur > 0:
        cur %= bin(cur).count("1")
        res += 1
    ans[i] = res

print(*ans, sep="\n")


### FIXED CODE ###

N = int(input())
X = input()

cnt = X.count("1")
res0 = 0
res1 = 0
for i in range(N):
    if X[i] == "1":
        res0 = (res0 + pow(2, N - i - 1, cnt + 1)) % (cnt + 1)

        if cnt - 1 > 0:
            res1 = (res1 + pow(2, N - i - 1, cnt - 1)) % (cnt - 1)

for i in range(N):
    ans = 0
    if X[i] == "0":
        div = cnt + 1
        tmp = (res0 + pow(2, N - i - 1, div)) % div
        ans += 1
    else:
        if cnt - 1 > 0:
            div = cnt - 1
            tmp = (res1 + div - pow(2, N - i - 1, div)) % div
            ans += 1
        else:
            tmp = 0

    while tmp > 0:
        ans += 1
        div = bin(tmp).count("1")
        tmp %= div
        
    print(ans)
from math import floor, sqrt
from collections import Counter

MOD = 10 ** 9 + 7

# xを素因数分解する
def getPrimeFactor(x):
    ans = []
    for d in range(2, floor(sqrt(x)) + 1):
        while x % d == 0:
            ans.append(d)
            x //= d

    if x != 1:
        ans.append(x)

    return ans

# xのn乗（二分累乗法）
def power(x, n):
    ans = 1
    while n:
        if n % 2 == 1:
            ans = (ans * x) % MOD
        x = (x * x) % MOD
        n //= 2
    return ans


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

PFs = getPrimeFactor(M)
cnt = Counter(PFs)

maxNum = max(cnt.values())
N2 = N + maxNum

# facts[x]: xの階乗
facts = [1] + [0] * N2
for x in range(1, N2 + 1):
    facts[x] = (facts[x - 1] * x) % MOD

# invFs[x]: xの階乗の逆元
invFs = [0] * N2 + [power(facts[N2], MOD - 2)]
for x in reversed(range(N2)):
    invFs[x] = (invFs[x + 1] * (x + 1)) % MOD

def comb(n, k):
    return ((facts[n] * invFs[k]) % MOD * invFs[n - k]) % MOD


ans = 1
for num in cnt.values():
    ans = (ans * comb(N + num - 1, num)) % MOD
print(ans)


### FIXED CODE ###

from math import floor, sqrt
from collections import Counter

MOD = 10 ** 9 + 7

# xを素因数分解する
def getPrimeFactor(x):
    ans = []
    for d in range(2, floor(sqrt(x)) + 1):
        while x % d == 0:
            ans.append(d)
            x //= d

    if x != 1:
        ans.append(x)

    return ans

# xのn乗（二分累乗法）
def power(x, n):
    ans = 1
    while n:
        if n % 2 == 1:
            ans = (ans * x) % MOD
        x = (x * x) % MOD
        n //= 2
    return ans


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

PFs = getPrimeFactor(M)
cnt = Counter(PFs)

N2 = N
if len(cnt):
    N2 += max(cnt.values())

# facts[x]: xの階乗
facts = [1] + [0] * N2
for x in range(1, N2 + 1):
    facts[x] = (facts[x - 1] * x) % MOD

# invFs[x]: xの階乗の逆元
invFs = [0] * N2 + [power(facts[N2], MOD - 2)]
for x in reversed(range(N2)):
    invFs[x] = (invFs[x + 1] * (x + 1)) % MOD

def comb(n, k):
    return ((facts[n] * invFs[k]) % MOD * invFs[n - k]) % MOD


ans = 1
for num in cnt.values():
    ans = (ans * comb(N + num - 1, num)) % MOD
print(ans)
a = input()
if int(a) % sum(map(int,a)):
    print('No')
else:
    print('Yes')
print('No' if int(a) % sum(map(int,a)) else 'Yes')

### FIXED CODE ###

S = input()
print(S.count('+') - S.count('-'))
A = int(input())
B = int(input())

if A < 1 or A > 9 or B < 1 or B > 9:
    print("-1")
else:
    print(A*B)

### FIXED CODE ###

A, B = map(int, input().split())
if A < 1 or A > 9 or B < 1 or B > 9:
    print("-1")
else:
    print(A*B)
from collections import deque

S = deque(input())
Q = int(input())

reverse = False
cnt = 0
for i in range(Q):
    inp = input().split()
    if inp[0] == "1":
        cnt += 1
        reverse = (cnt % 2 != 0)
        #S = S[::-1]
    else:
        f, c = inp[1:]
        if int(f) == 1:
            if reverse:
                S.append(c)
            else:
                S.leftappend(c)
        else:
            if reverse:
                S.leftappend(c)
            else:
                S.append(c)
S = "".join(S)
print(S[::-1] if reverse else S)

### FIXED CODE ###

from collections import deque

S = deque(input())
Q = int(input())

reverse = False
cnt = 0
for i in range(Q):
    inp = input().split()
    if inp[0] == "1":
        cnt += 1
        reverse = (cnt % 2 != 0)
        #S = S[::-1]
    else:
        f, c = inp[1:]
        if int(f) == 1:
            if reverse:
                S.append(c)
            else:
                S.appendleft(c)
        else:
            if reverse:
                S.appendleft(c)
            else:
                S.append(c)
S = "".join(S)
print(S[::-1] if reverse else S)
N, X = map(int, input().split())

result = 'P'

for i in range(1, N+1):
    result = 'B' + result + 'P' + result + 'B'
    if len(result) >= X:
        break
    
print(result[:X].count('P'))

### FIXED CODE ###

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

a, p = [1], [1]
for i in range(N):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)

def f(N, X): # X <= 0 や X > a_N を許容し解説本文から簡略化
    if N == 0:
        return 0 if X <= 0 else 1
    elif X <= 1 + a[N-1]:
        return f(N-1, X-1)
    else:
        return p[N-1] + 1 + f(N-1, X-2-a[N-1])

print(f(N, X))
import bisect
n=int(input())
A=[int(input())]
for i in range(n-1):
  a=int(input())
  b=bisect.bisect_right(A,a,lo=0,hi=len(A))
  if b!=0 and A[b-1]<a:
    A[b-1]=a
  elif A[b-1]==a:
    b=bisect.bisect_right(A,a-1,lo=0,hi=len(A))
    if b!=0:
      A[b-1]=a
    else:
      A.insert(0,a)
  else:
    A.insert(0,a)
print(len(A))


### FIXED CODE ###

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