Harryxun/stf_run huggingface dataset:
import functools

def sign(x):
    if x>0:
        return 1
    elif x==0:
        return 0
    else:
        return -1
    
def multiply(x,y):
    ans = x*y
    if ans>=10**9+7:
        ans %= 10**9+7
    return ans

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

if A[-1]<0 and K%2==1:
    combi = A[-K:]
    if K >1:
        answer =  functools.reduce(multiply,map(abs,combi[:-1]))
        answer *= combi[-1]
    else:
        answer = combi[0]
    answer %= 10**9+7
else:
    signs = 1
    i,j = 0,0
    for _ in range(K):
        if abs(A[i]) > abs(A[N-j-1]):
            signs *= sign(A[i])
            i += 1
            
        else:
            signs *= sign(A[N-j-1])
            j += 1
    combi = A[N-j:] + A[:i]
    del A[N-j:]
    del A[:i]
    combi = combi[::-1]     
       
    if signs == -1:
        if combi[0]*A[0] > combi[-1]*A[-1]:
            del combi[-1]
            combi.insert(0,A[0])
        else:
            del combi[0]
            combi.append(A[-1])
        '''
        if combi[-1] <0:
            del combi[0]
            combi.append(A[-1])
        else:
            if A[0]>0:
                del combi[0]
                combi.append(A[-1])
            elif A[0]<0 and A[-1] >0:
                if combi[0]*A[0] > combi[-1]*A[-1]:
                    del combi[-1]
                    combi.insert(0,A[0])
                else:
                    del combi[0]
                    combi.append(A[-1])
            else:
                del combi[-1]
                combi.insert(0,A[0]) 
        '''

    answer =  functools.reduce(multiply,map(abs,combi))
print(answer)

### FIXED CODE ###

import functools

def sign(x):
    if x>0:
        return 1
    elif x==0:
        return 0
    else:
        return -1
    
def multiply(x,y):
    ans = x*y
    if ans>=10**9+7 or ans<0:
        ans %= (10**9+7)
    return ans

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

if (A[-1]<0 and K%2==1):
    combi = A[-K:]
    if K >1:
        answer =  functools.reduce(multiply,combi)

elif K == N:
    answer = functools.reduce(multiply,A)
    
else:
    signs = 1
    i,j = 0,0
    for _ in range(K):
        if abs(A[i]) > abs(A[N-j-1]):
            signs *= sign(A[i])
            i += 1
            
        else:
            signs *= sign(A[N-j-1])
            j += 1
    combi = A[N-j:] + A[:i]
    del A[N-j:]
    del A[:i]
    combi = combi[::-1]     
       
    if signs == -1:
        if A:
            if combi[-1]<0:
                del combi[0]
                combi.append(A[-1])
            elif A[0]>=0:
                del combi[0]
                combi.append(A[-1])
            elif A[0]<0 and A[-1] >0:
                if combi[0]*A[0] > combi[-1]*A[-1]:
                    del combi[-1]
                    combi.insert(0,A[0])
                else:
                    del combi[0]
                    combi.append(A[-1])
            elif A[-1] <= 0:
                del combi[-1]
                combi.insert(0,A[0]) 
                
    answer =  functools.reduce(multiply,combi)
print(answer)
import numpy as np
import math

line = input().split()
N = int(line[0])
X = int(line[1])

line = input().split()


diff = [abs(int(x)-X) for x in line]

min_ = math.gcd(diff[0], diff[0])

for df in diff:
    min_ = min(min_, math.gcd(diff[0], df))

print(min_)

### FIXED CODE ###

import numpy as np

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
    
line = input().split()
N = int(line[0])
X = int(line[1])

line = input().split()

diff = [abs(int(x)-X) for x in line]

min_ = gcd(diff[0], diff[0])

for df in diff:
    min_ = min(min_, gcd(diff[0], df))

print(min_)
a=int(input())
s=int(input())

if a>=3200:
  print(s)
else:
  print('red')

### FIXED CODE ###

a=int(input())
s=input()
if a>=3200:
    print(s)
else:print('red')
n = input()
k = input()
s = input()

word = s[k-1].lower()

b = s[:k-1]

a = s[k:]

new_s = b + word + a

print(new_s)

### FIXED CODE ###


n, k = map(int, input().split())
#k = input()
s = input()

word = s[k-1].lower()

b = s[:k-1]

a = s[k:]

new_s = b + word + a

print(new_s)
def fibo(n):
	S=[1,1]
	s=1
	if n>1:
		for i in range(2,n+1):
			S.append(S[i-1]+S[i-2])
			s=S[i]
	return s

def main():
	if __name__=="__main__":
		n=input()
		print(fibo(n))

main()

### FIXED CODE ###

def fibo(n):
	S=[1,1]
	s=1
	if n>1:
		for i in range(2,n+1):
			S.append(S[i-1]+S[i-2])
			s=S[i]
	return s

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

main()
a, b, c = map(int, input().split())
print(min(b//a, c))

### FIXED CODE ###

S = list(input())
n0 = S.count('0')
n1 = S.count('1')
print(2*min(n0, n1))
import math
import copy
 
 
 
 
def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:
 
            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l
 

n=input()
s=input()

mod=int(math.pow(10, 9)+7)
def help1(a):
    all=0
    a1=1
    b1=1
    while a!=0:
        a1=a1*a;
        a1=a1/b1;
        b1+=1
        a=a-1
        all=(all+a1)%mod
    return int(all)

def func():
    count=help1(len(s))
    dic={}

    for c in s:
        if c in dic:
            dic[c]=dic[c]+1
        else:
            dic[c]=1
    res=len(s)
    l=[]
    for k in dic:
        if dic[k]==1:
            l.append(k)
    for obj in l:
        del dic[obj]
        
    count2=1
    sum1=0
    for k in dic:
        sum1+=dic[k]
        count2=count2*(1+dic[k])



    number3=help1(sum1)-count2+1

    number4=help1(len(s)-sum1)+1

    number3=number3*number4
    return count-number3
  

print(func())


### FIXED CODE ###

import math
import copy
from collections import Counter
 
 
 
def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:
 
            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l
 

n=input()
s=input()

mod=7+10**9


def func():

    dic = Counter(s)
    ans = 1
    for x in dic:
        ans = ans*(dic[x]+1)%mod
    return ans-1
    
print(func())
from itertools import permutations

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

cnt=0
for i in permutations(range(1,m)):
    if i[0] in tree[0]:
        t_cnt=1
        for j in range(1,len(i)):
            if i[j] in tree[i[j-1]]:
                t_cnt+=1
        if t_cnt==m-1:
            cnt+=1
print(cnt)

### FIXED CODE ###

from itertools import permutations

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

cnt=0
for i in permutations(range(1,n)):
    if i[0] in tree[0]:
        t_cnt=1
        for j in range(1,len(i)):
            if i[j] in tree[i[j-1]]:
                t_cnt+=1
            else:
                break
        if t_cnt==n-1:
            cnt+=1
print(cnt)
W, H, x, y = map(int, input().split())
S = W * H / 2
if W / x == 2 and H / y == 2:
    res = 1
else:
    res = 0
print(S, res)

### FIXED CODE ###

W, H, x, y = map(int, input().split())
S = W * H / 2
if W / 2 == x and H / 2 == y:
    res = 1
else:
    res = 0
print(S, res)
class Factorial:
    def __init__(self, n, mod=10**9+7):
        self.fac = [0] * (n+1)
        self.ifac = [0] * (n+1)
        self.fac[0] = 1
        self.ifac[0] = 1
        self.mod = mod
        modmod = self.mod - 2
        for i in range(n):
            self.fac[i+1] = self.fac[i] * (i+1) % self.mod
            self.ifac[i+1] = self.ifac[i] * pow(i+1, modmod, self.mod) % self.mod

    def comb(self, n, r):
        if n == 0 and r == 0:
            return 1
        if n < r or n < 0:
            return 0
        tmp =  self.ifac[n-r] * self.ifac[r] % self.mod
        return tmp * self.fac[n] % self.mod

    def perm(self, n, r):
        if n == 0 and r == 0:
            return 1
        if n < r or n < 0:
            return 0
        return (self.fac[n] * self.ifac[n-r]) % self.mod


N, a, b = map(int,input().split())
mod = 10**9+7

fact = Factorial(N)
sum = 1
for i in range(N) :
    sum = (sum * 2) % mod

sum = (sum - fact.comb(N,a) - fact.comb(N,b) - 1) % mod
print(sum)

### FIXED CODE ###

n, a, b = map(int, input().split())
mod = 10**9 + 7

def comb(n, r, mod):
    X = 1
    Y = 1
    for i in range(1,r+1):
        X = (X*(n-i+1))%mod
        Y = (Y*i)%mod
    return (X*pow(Y, mod-2, mod))%mod

ans = (pow(2, n, mod) -1 - comb(n, a, mod) - comb(n, b, mod))%mod
print(ans)
BIT = [0] * ((1 << 19) + 1)
def add(i, x):
    while i <= (1 << 19):
        BIT[i] += x
        i += i & -i
def query(i):
    res = 0
    while i > 0:
        res += BIT[i]
        i -= i & -i
    return res
n, q = map(int, input().split())
c = list(map(int, input().split()))
Q = [[] for i in range(n)]
for i in range(q):
    l, r = map(int, input().split())
    Q[r - 1].append([l - 1, i])
l = [-1] * n
a = [-1] * q
add(1, n)
for i in range(n):
    add(l[c[i]] + 2, -1)
    add(i + 2, 1)
    l[c[i]] = i
    for j in Q[i]:
        a[j[1]] = query(1 << 19) - query(j[0] + 1)
print(*a, sep="\n")

### FIXED CODE ###

BIT = [0] * ((1 << 19) + 1)
def add(i, x):
    while i <= (1 << 19):
        BIT[i] += x
        i += i & -i
def query(i):
    res = 0
    while i > 0:
        res += BIT[i]
        i -= i & -i
    return res
n, q = map(int, input().split())
c = list(map(int, input().split()))
Q = [[] for i in range(n)]
for i in range(q):
    l, r = map(int, input().split())
    Q[r - 1].append([l - 1, i])
l = [-1] * n
a = [-1] * q
add(1, n)
for i in range(n):
    add(l[c[i] - 1] + 2, -1)
    add(i + 2, 1)
    l[c[i] - 1] = i
    for j in Q[i]:
        a[j[1]] = query(1 << 19) - query(j[0] + 1)
print(*a, sep="\n")
a,b = (int(x) for x in input.split())
 
print(round((a/b),10))

### FIXED CODE ###

a,b = [int(x) for x in input().split()]
 
print(round((a/b),10))
n = int(input())
A = list(map(int, input().readline().split()))
B = list(map(int, input().readline().split()))

for i in range(n):
    sumA = A[i] + sumA
    sumB = B[i] + sumB

if sumA < sumB:
    print("Yes")
else:
    print("No")


### FIXED CODE ###


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

sumA = 0
sumB = 0
sumAB = 0

for i in range(n):
    sumA += A[i]
    sumB += B[i]

for i in range(n):
    if A[i] < B[i]:
        sumAB += int((B[i] - A[i]) / 2 + 0.5)

if sumAB <= sumB - sumA:
    print("Yes")
else:
    print("No")
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    try:
        continue

if f >= c:
    print("Yes")
else :
    print("No")

### FIXED CODE ###

b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    if -e>b:
        break

if f >= c:
    print("Yes")
else :
    print("No")
import copy

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

result = 0

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def gcd_list(nums):
    x = gcd(nums[0],nums[1])
    for i in range(2,len(nums)):
        x = gcd(nums[i],x)
    return x

for i in range(N):
    a = copy.deepcopy(A)
    del a[i]
    result = max(gcd_list(a),result)

print(result)

### FIXED CODE ###

from fractions import gcd

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

gcdl = [1]*N
gcdl[0] = A[0]

gcdr = [1]*N
gcdr[-1] = A[-1]

for i in range(1, N):
    gcdl[i] = gcd(gcdl[i-1], A[i])
    gcdr[N-i-1] = gcd(gcdr[N-i], A[N-i-1])

res = max(gcdl[N-2], gcdr[1])

for i in range(1, N-1):
    res = max(gcd(gcdl[i-1], gcdr[i+1]), res)

print(res)
import numpy as np

n,k = map(int,input().split())
p_list = np.fromstring(input(), int)

Cumulative_sum = np.zeros(n+1, np.int64)
Cumulative_sum[1:] = p_list.cumsum()

length_k_sum_list = Cumulative_sum[k:] - Cumulative_sum[0:-k]

ans = (length_k_sum_list.max() + k) / 2

print(ans)


### FIXED CODE ###

import sys
import numpy as np

val = np.fromstring(sys.stdin.buffer.read(), np.int64, sep=' ')
n,k = val[:2]
p_list = val[2:]

S = np.zeros(n+1, np.int64)
S[1:] = p_list.cumsum()

KS = S[k:] - S[0:-k]
print((KS.max()+k)/2)
import math

A,B,H,M =int(input("A :")),int(input("B :")),int(input("H :")),int(input("M :"))
if 1<=A<=1000 and 1<=B<=1000 and 0<=H<=11 and 0<=M<=59:
    hw=(2*math.pi)/(12*60*60) #時針の角速度[rad/s]
    mw=(2*math.pi)/(60*60) #分針の角速度[rad/s]
    time_h=H*60*60 #Hour時間[s] 
    time_m=M*60 #Min時間[s]
    aw=hw*(time_h+time_m) #Arad[rad] #最後の鬼門だった！！なるほどね！40min経ってる間に時針も進んでるから。。
    bw=mw*time_m #Brad[rad]
    rad=abs(bw-aw)
    # 正弦定理で出力結果を得る(a^2=b^2+c^2-2bccosθ)
    print(math.sqrt(A**2+B**2-2*A*B*math.cos(rad)))

### FIXED CODE ###

import math

A,B,H,M =map(int, input().split())
if 1<=A<=1000 and 1<=B<=1000 and 0<=H<=11 and 0<=M<=59:
    hw=(2*math.pi)/(12*60*60) #時針の角速度[rad/s]
    mw=(2*math.pi)/(60*60) #分針の角速度[rad/s]
    time_h=H*60*60 #Hour時間[s] 
    time_m=M*60 #Min時間[s]
    aw=hw*(time_h+time_m) #Arad[rad] #最後の鬼門だった！！なるほどね！40min経ってる間に時針も進んでるから。。
    bw=mw*time_m #Brad[rad]
    rad=abs(bw-aw)
    # 正弦定理で出力結果を得る(a^2=b^2+c^2-2bccosθ)
    print(math.sqrt(A**2+B**2-2*A*B*math.cos(rad)))
    #確認用
    #print(time_h,time_m,aw,bw,rad) 
else: 
    print("各値の条件は次の通り:1<=A,B<=1000,0<=H<=11,0<=M<=59")
    print("あなたの入力:A={},B={},H={},M={}".format(A,B,H,M))
q, h, s, d = map(int, input().split())
n = int(input())
ans = 0
q_per = q / 0.25
h_per = h / 0.5
s_per = s
d_per = d / 2
list = [q_per,h_per,s_per,d_per]
elif min(list) == d_per :
    if n%2 == 0:
        ans += d * (n //2)
    else :
        ans += n//2 * d
        n -= n//2
        list.remove(d_per)
        if min(list) == s_per :
            ans += s_per
        elif min(list) == h_per :
            ans += h * 2
        else :
            ans += q * 4
elif min(list) == s_per :
    ans += n * s
elif min(list) == h_per :
    ans += n * 2 * h
else :
    ans += n * 4 * q

print(int(ans))


### FIXED CODE ###

q, h, s, d = map(int, input().split())
n = int(input())
ans = 0
q_per = q / 0.25
h_per = h / 0.5
s_per = s
d_per = d / 2
list = [q_per,h_per,s_per,d_per]
if min(list) == d_per :
    if n%2 == 0:
        ans += d * (n //2)
    else :
        ans += n//2 * d
        n -= n//2
        list.remove(d_per)
        if min(list) == s_per :
            ans += s_per
        elif min(list) == h_per :
            ans += h * 2
        else :
            ans += q * 4
elif min(list) == s_per :
    ans += n * s
elif min(list) == h_per :
    ans += n * 2 * h
else :
    ans += n * 4 * q

print(int(ans))
import math
N, K = map(int, input().split())

M = []
x = 1
while x < (10 ** 5) * 2:
    M.append(1 / x)
    x <<= 1

p1 = max((N - K + 1) / N, 0)
p = 0
for i in range(1, min(N + 1, K)):
    t = int(math.log2(K / i)) + 1
    if K % i == 0 and  (K // i) & (K // i - 1) == 0:
        t -= 1
    p += M[t]
print(p / N + p1)


### FIXED CODE ###

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

M = []
x = 1
while x < (10 ** 5) * 2:
    M.append(1 / x)
    x <<= 1

p1 = max((N - K + 1) / N, 0)
p = 0
for i in range(1, min(N + 1, K)):
    t = int(math.log2(K / i)) + 1
    if K % i == 0 and  (K // i) & (K // i - 1) == 0:
        t -= 1
    p += M[t]
ans = p / N + p1
print('{0:.10f}'.format(ans))
s = list(input())
cnt = 0

for i in s:
  if i = '+':
    cnt = cnt +1
  if i = '-':
    cnt = cnt-1

print(cnt)

### FIXED CODE ###

s = input()
cnt = 0
 
for i in s:
  if i == '+':
    cnt = cnt +1
  elif i == '-':
    cnt = cnt-1
 
print(cnt)
def main():
    n = input()
    print((n * (n + 1)) / 2)
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n = int(input())
    print(int((n * (n + 1)) / 2))
if __name__ == '__main__':
    main()
n = int(input())
d = [int(i) for input().split()]
s = []
for i in range(n):
	for j in range(i):
		s.append(d[i]*d[j])
n = s.size()
for i in range(n):
	print(s[i])

### FIXED CODE ###

n = int(input())
d = [int(i) for i in input().split()]
s = []
for i in range(n):
	for j in range(i):
		s.append(d[i]*d[j])
print(sum(s))
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

def gcd(n,m):
    if m == 0:
        return n
    else:
        return gcd(m,n%m)

def lcm(n,m):
    return n*m//gcd(n,m)

n,m = LI()
a = LI()
b = [i//2 for i in a]
for i in range(n):
    if b[i] % 2 == 0:
        print(0)
        quit()

l = lcm(b[0],b[1])
for i in range(2,n):
    l = lcm(l,b[i])

print(m//(l*2)+1)

### FIXED CODE ###

#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

def gcd(n,m):
    if m == 0:
        return n
    else:
        return gcd(m,n%m)

def lcm(n,m):
    return n*m // gcd(n,m)


n,m = LI()
a = LI()
b = [i//2 for i in a]

lb = 1
for i in b:
    lb = lcm(lb,i)
    if lb > m:
        print(0)
        quit()

for i in b:
    if lb//i % 2 == 0:
        ans = 0
        break
else:
    if lb > m:
        ans = 0
    else:
        ans = (m//lb + 1)//2
print(ans)
N, P = map(int, input().split())
S = input()
if P == 2:
    counter = 0
    for i in range(len(S)):
        if S[i] in ['2', '4', '6', '8', '0']:
            counter += i + 1
    print(counter)
elif P == 5:
    counter = 0
    for i in range(len(S)):
        if S[i] in ['5', '0']:
            counter += i + 1
    print(counter)
else:
    list_a = [0] * P
    list_a[0] += 1
    counter = 0
    temp = 0
    power = 1
    for i in range(N):
        temp += pow(10, i, mod=P) * int(S[N-i-1])
        temp %= P
        counter += list_a[temp]
        list_a[temp] += 1
    print(counter)



### FIXED CODE ###

N, P = map(int, input().split())
S = input()
if P == 2:
    counter = 0
    for i in range(len(S)):
        if S[i] in ['2', '4', '6', '8', '0']:
            counter += i + 1
    print(counter)
elif P == 5:
    counter = 0
    for i in range(len(S)):
        if S[i] in ['5', '0']:
            counter += i + 1
    print(counter)
else:
    list_a = [0] * P
    list_a[0] += 1
    counter = 0
    temp = 0
    power = 1
    for i in range(N):
        power *= 10
        power %= P
        temp += power * int(S[N-i-1])
        temp %= P
        counter += list_a[temp]
        list_a[temp] += 1
    print(counter)
import math
import itertools
N = int(input())
array=[]
for i in range(0, N-1):
    array.append(input().split())
dist3=[]
for row in array:
    a,b=row
    c = []
    d=[]
    for tmpc1,tmpc2 in array:
        if tmpc1 == a and tmpc2 != a and tmpc2!=b:
            c.append(int(tmpc2)-1)
        if tmpc1 != a and tmpc2 == a and tmpc1 != b:
            c.append(int(tmpc1)-1)
    for tmpd1,tmpd2 in array:
        if tmpd1 == b and tmpd2!=a and tmpd2 != b and tmpd2!=c:
            d.append(int(tmpd2)-1)
        if tmpd1 != b and tmpd1!=a and tmpd2 == b and tmpd1!=c:
            d.append(int(tmpd1)-1)
    if c != [] and d != []:
        #print("{} {} {} {}".format(a, b, c, d))
        dist3.append([c, d])
        
for kouho in itertools.permutations(list(range(1,N+1)),N):
    breakflag=False
    for c, d in dist3:
        for tmpc in c:
            for tmpd in d:
                if (kouho[tmpc] + kouho[tmpd]) % 3 != 0 and (kouho[tmpc] * kouho[tmpd]) % 3 != 0:
                    breakflag = True
                    break
                #else:
                    #print("{} {} {} {}".format( tmpc, tmpd,kouho[tmpc],kouho[tmpd]))
            if breakflag==True:
                break
        if breakflag!=True:
            print(' '.join(map(str,kouho)))
            exit()

print('-1')

### FIXED CODE ###

import re
strin=input()
pattern = '(hi)+$'
if re.match(pattern, strin):
    print("Yes")
else:
    print("No")
l = [A+B, A-B, A*B]
print(max(l, key=int))

### FIXED CODE ###

i = list(map(int, input().split()))
l = [i[0] + i[1], i[0] - i[1], i[0]*i[1]]
print(max(l, key=int))
s=input()
n=len(s)-1
l=[]
for i in range(n):
    l.append("+")
sum = 0
for i in range(2 ** n):
    plus = []
    tmp = ""
    ans = 0
    for j in range(n):
        if ((i>>j) & 1):
            plus.append(l[j])
        else:
            plus.append("")
    for i in range(n):
        tmp += s[i]+plus[i]
        if i == n-1:
            tmp+=s[i+1]
    tmp2 = tmp.split("+")
    for i in range(len(tmp2)):
        ans += int(tmp2[i])
    sum+=ans
print(sum)



### FIXED CODE ###

s=input()
n=len(s)-1
l=[]
for i in range(n):
    l.append("+")
sum = 0

if len(s) < 2:
    sum = s

else:
    for i in range(2 ** n):
        plus = []
        tmp = ""
        ans = 0
        for j in range(n):
            if ((i>>j) & 1):
                plus.append(l[j])
            else:
                plus.append("")
        for i in range(n):
            tmp += s[i]+plus[i]
            if i == n-1:
                tmp+=s[i+1]
        tmp2 = tmp.split("+")
        for i in range(len(tmp2)):
            ans += int(tmp2[i])
        sum+=ans

print(sum)