Harryxun/stf_run huggingface dataset:
n = int(input())
res = 0
for a in range(n):
  b = n - a
  res = sum(map(int, str(a))) + sum(map(int, str(b)))
 print(res)

### FIXED CODE ###

n = input()
res = 1<<10
def ds(x):
    return sum(map(int,list(str(x))))

for a in range(1,n):
    b = n - a
    res = min(ds(a) + ds(b), res)

print res
a,b = map(int,input())

ans = 0
a = max(a,b)
b = min(a,b)
ans += a
a -= 1
a = max(a,b)
b = min(a,b)
ans += a

print(ans)

### FIXED CODE ###

a,b = map(int,input().split())
 
ans = 0
c = max(a,b)
d = min(a,b)
ans += c
c -= 1
e = max(c,d)
f = min(a,b)
ans += e
 
print(ans)
from typing import Tuple
from itertools import permutations


class Solution:
    def CountOrder(self, sequence1: Tuple[int], sequence2: Tuple[int]):
        l = list(permutations(range(1, n + 1)))
        index1 = l.index(sequence1)
        index2 = l.index(sequence2)
        return abs(index1 - index2)


if __name__ == "__main__":
    n = int(input())
    sequence1 = tuple(map(int, input().split()))
    sequence2 = tuple(map(int, input().split()))
    solution = Solution()
    print(solution.CountOrder(sequence1, sequence2))



### FIXED CODE ###

from itertools import permutations


class Solution:
    def CountOrder(self, sequence1, sequence2):
        l = list(permutations(range(1, n + 1)))
        index1 = l.index(sequence1)
        index2 = l.index(sequence2)
        return abs(index1 - index2)


if __name__ == "__main__":
    n = int(input())
    sequence1 = tuple(map(int, input().split()))
    sequence2 = tuple(map(int, input().split()))
    solution = Solution()
    print(solution.CountOrder(sequence1, sequence2))
X,N = map(int,input().split())
if N==0:
    print(X)
    exit()
P = [int(i) for i in input().split()]
ans = X+10
tmp = []
P2 = [int(i) for i in range(min(P),max(P)+1)]
P3 = list(set(P2)-set(P))

for i in P3:
    if ans > abs(X-i):
        ans = abs(X-i)
        tmp.append(i)
print(max(tmp))

### FIXED CODE ###

X,N = map(int,input().split())
if N==0:
    print(X)
    exit()
P = [int(i) for i in input().split()]

ans = X+10
tmp = []
P2 = [int(i) for i in range(-200,200)]
P3 = list(set(P2)-set(P))
P3.sort()
P3[::-1]
for i in P3:
    if ans > abs(X-i):
        ans = abs(X-i)
        tmp.append(i)
print(max(tmp))
n=int(input())
A=[int(i) for i in input().split()]
if len(set(A))==n:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

n,k=map(int,input().split())
P=[int(i) for i in input().split()]
ans=0
for i in range(k):
  ans+=(P[i]+1)/2
cur=ans
for i in range(k,n):
  cur+=(P[i]+1)/2
  cur-=(P[i-k]+1)/2
  if cur>ans:
    ans=cur
print(ans)
n = int(input())
a = list(map(int, input().split()))

a.sort(reverse=True)
ans = a[0]
i = 1
while True:
    ans += a[i]
    i += 1
    if i == n - 1:
        break
    ans += a[i]
    i += 1
    if i == n - 1:
        break
print(ans)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = a[0]
idx = 1
for i in range(1, n):
    if idx == n - 1:
        break
    ans += a[i]
    idx += 1
    if idx == n - 1:
        break
    ans += a[i]
    idx += 1
print(ans)
C =str(input())


if C[0] == C[5] and C[1] == C[4] and C[2] == C[3]:
    print('Yes')

else:
    print('No')


### FIXED CODE ###


C1 =str(input())
C2 =str(input())

if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
    print('YES')

else:
    print('NO')
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)

if n == 1:
    while m > 0:
        a[0] //= 2
        m -= 1
    print(a[0])
    exit()

while m > 0:
    a.sort(reverse = True)
    mid = a[0] // 2
    i = 0
    while a[i] >= mid:
        if i == n:
            break
        if m > 0:
            a[i] //= 2
            m -= 1
            i += 1
        else:
            break
print(sum(a))


### FIXED CODE ###

n, m = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)

if n == 1:
    while m > 0:
        a[0] //= 2
        m -= 1
    print(a[0])
    exit()

while m > 0:
    a.sort(reverse = True)
    mid = a[0] // 2
    i = 0
    while a[i] >= mid:
        if m > 0:
            a[i] //= 2
            m -= 1
            i += 1
        else:
            break
        if i == len(a):
            break
print(sum(a))
S = input()
N = len(S)+1
array = [0]*(N)
for i in range(N-1):
  if S[i] == "<":
    array[i+1] = array[i] + 1
    k = i+1
#  elif array[i] > array[i+1]:
#    k = i+1
  else:
    for j in reversed(range(k,i+1)):
      if array[j]<=array[j+1]:
        array[j] += 1
#print(array)
print(sum(array))

### FIXED CODE ###

S = input()
N = len(S)+1
k = 0
score= 0
countup = 0
countdown = 0
final = None
for i in range(N-1):
  if S[i] == "<":
    if final == ">":
      score += int(countdown*(countdown-1)/2)
      if countup <= countdown:
        score += countdown - countup
      countup = 0
    countdown = 0
    final = "<"
    countup += 1
    score += countup
  elif S[i] == ">":
    final = ">"
    countdown += 1
if final == ">":
  score += int(countdown*(countdown-1)/2)
  if countup <= countdown:
    score += countdown - countup
print(score)
from bisect import *
from collections import *
from fractions import gcd
from math import factorial
from itertools import *
from heapq import *
import math



N=int(input())
LR=[list(map(int,input().split())) for i in range(N)]
value=max([R-L for L,R in LR])+1
LR=sorted(LR,key=lambda x:x[0])

L1,R1=LR[0]
L2,R2=LR[1]
for i in range(2,N):
    L,R=LR[i]
    L2=L
    R2=min(R2,R)
a=max(R1-L1+1,0)
b=max(R2-L2+1,0)
value=max(value,a+b)

logN=math.log2(N)
#table=[[0 for i in range(logN)] for n in range(N)]
minRlst=[2*(10**10) for i in range(N)]
minRlst[-1]=LR[-1][1]
for i in range(N-2,-1,-1):
    minRlst[i]=min(minRlst[i+1],LR[i][1])
for i in range(1,N-1):
    L,R=LR[i]
    L1,R1=L,min(R1,R)
    R2=minRlst[i+1]
    a=max(R1+1-L1,0)
    b=max(R2+1-L2,0)
    value=max(value,a+b)
print(value)


### FIXED CODE ###

from bisect import *
from collections import *
from fractions import gcd
from math import factorial
from itertools import *
from heapq import *



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

value=max([R-L for L,R in LR])
#LR=sorted(LR,key=lambda x:x[1])
LR=sorted(LR,key=lambda x:x[0]*10**9+x[1])
a=2*(10**9)
minRlst=[a for i in range(N)]
minRlst[-1]=LR[-1][1]
maxLlst=[0 for i in range(N)]
maxLlst[0]=LR[0][0]
for i in range(N-2,-1,-1):
    minRlst[i]=min(minRlst[i+1],LR[i][1])
for i in range(1,N):
    maxLlst[i]=max(minRlst[i-1],LR[i][0])
L1,R1=LR[0]
L2,R2=LR[-1][0],minRlst[1]
maxR=min([R for L,R in LR])
for i in range(0,N-1):
    L,R=LR[i]
    a=max(R-L,0)
    b=max(maxR-LR[-1][0],0)
    value=max(value,a+b)
    L1=L
    R1=min(R1,R)
    R2=minRlst[i+1]
    a=max(R1-L1,0)
    b=max(R2-L2,0)
    value=max(value,a+b)
print(value)
B = [False]*10010
C = [0]*10010
for i in range(2,10005):
    if !B[i]:
        j = i+i
        while j < 10005:
            B[j]= True
            j+=i
for i in range(3,10005,2):
    if !B[i] and !B[(i+1)//2]:
        C[i]+=1
for i in range(3,10005):
    C[i]=C[i]+C[i-1]
    
N = int(input())
for _ in range(N):
    a, b = map(int,input().split())
    print(c[b]-c[a-1])

### FIXED CODE ###

B = [False]*100005
C = [0]*100005
for i in range(2,100001):
    if not B[i]:
      	for j in range(i+i,100001,i):
          	B[j]=True
for i in range(3,100001,2):
    if not B[i] and not B[(i+1)//2]:
        C[i]+=1
for i in range(3,100001):
    C[i]=C[i]+C[i-1]
    
N = int(input())
for _ in range(N):
    a, b = map(int,input().split())
    print(C[b]-C[a-1])
N = int(input())
P = []
maximum_val = 0
maximum_index = Null

for i in range(N):
  a = int(input())
  P.append(a)
  if a > maximum_val:
    maximum_val = a
    maximum_index = i
print(sum(P) - P[maximum_index])


### FIXED CODE ###

N = int(input())
P = []
maximum_val = 0
maximum_index = 0

for i in range(N):
	a = int(input())
	P.append(a)
	if a > maximum_val:
		maximum_val = a
		maximum_index = i
print(int(sum(P) - P[maximum_index] / 2))
S=input()
N=len(S)
mod= 998244353

FACT=[1]
for i in range(1,2*10**5+1):
    FACT.append(FACT[-1]*i%mod)

FACT_INV=[pow(FACT[-1],mod-2,mod)]
for i in range(2*10**5,0,-1):
    FACT_INV.append(FACT_INV[-1]*i%mod)

FACT_INV.reverse()

def Combi(a,b):
    if 0<=b<=a:
        return FACT[a]*FACT_INV[b]*FACT_INV[a-b]%mod
    else:
        return 0

R=0
B=0

RB=[[0,0]]*N

for i in range(N):
    s=S[i]
    if s=="0":
        R+=2
    elif s=="1":
        R+=1
        B+=1
    else:
        B+=2
    RB[i]=[R,B]

DP=[0]*(R+1)
DP[0]=1

for i in range(N):
    NDP=[0]*(R+1)
    red,blue=RB[i]
    for r in range(R+1):
        if DP[r]==0:
            continue
        if r+1<=red:
            NDP[r+1]+=DP[r]
        if i-r+1<=blue:
            NDP[r]+=DP[r]
    DP=NDP


ANS=0
for r in range(N+1):
    red=RB[-1][0]-r
    blue=RB[-1][1]-(N-r)

    ANS=ANS+DP[r]*Combi(red+blue,blue)
    ANS%=mod
print(ANS)

### FIXED CODE ###

S=input()
N=len(S)
mod= 998244353

FACT=[1]
for i in range(1,2*10**5+1):
    FACT.append(FACT[-1]*i%mod)

FACT_INV=[pow(FACT[-1],mod-2,mod)]
for i in range(2*10**5,0,-1):
    FACT_INV.append(FACT_INV[-1]*i%mod)

FACT_INV.reverse()

def Combi(a,b):
    if 0<=b<=a:
        return FACT[a]*FACT_INV[b]*FACT_INV[a-b]%mod
    else:
        return 0

R=0
B=0

RB=[[0,0]]*N

for i in range(N):
    s=S[i]
    if s=="0":
        R+=2
    elif s=="1":
        R+=1
        B+=1
    else:
        B+=2
    RB[i]=[R,B]

DP=[0]*(R+1)
DP[0]=1

for i in range(N):
    NDP=[0]*(R+1)
    red,blue=RB[i]
    for r in range(R+1):
        if DP[r]==0:
            continue
        if r+1<=red:
            NDP[r+1]+=DP[r]
        if i-r+1<=blue:
            NDP[r]+=DP[r]
    DP=NDP


ANS=0
for r in range(R+1):
    red=R-r
    blue=B-(N-r)

    ANS=ANS+DP[r]*Combi(red+blue,blue)
    ANS%=mod
print(ANS)
var = [int(input()) for _ in range(4)]
var.sort()
print("Yes" if var == [1,4,7,9] else "No")

### FIXED CODE ###

#!/usr/bin/env python3
a = list(map(int,input().split()))
a.sort()
print("YES" if a == [1,4,7,9] else "NO")
s = input()
l = len(s)

"""
def check_kaibun(kaibun):
    n = len(kaibun)
    middle = n // 2
    count = 0
    print("s[i]:{}".format(kaibun))
    for i in range(middle):
        if kaibun[i] == kaibun[n - i]:
            count += 1
        else:
            count = 0
            break
    if count == middle:
        return True
    else: 
        return False
"""

left_center = (l-2) // 2
right_center = (l+2) // 2

for i in range(left_center // 2):
    if s[i] != s[left_center - i]:
        print("No")
        break
else:
    for i in range(len(s[right_center:]) // 2):
        if s[right_center + i] != s[l - i - 1]:
            print("No")
            break
    else:
        right = True
"""
check1 = check_kaibun(s[:left_center])
check2 = check_kaibun(s[right_center:])
"""
if right == True: 
    print("Yes")


### FIXED CODE ###

s = input()
l = len(s)


def check_kaibun(kaibun):
    n = len(kaibun)
    middle = n // 2
    count = 0
    for i in range(middle):
        if kaibun[i] == kaibun[n - i - 1]:
            count += 1
        else:
            count = 0
            break
    if count == middle:
        return True
    else: 
        return False


left_center = (l-2) // 2
right_center = (l+2) // 2

check0 = check_kaibun(s)
check1 = check_kaibun(s[:left_center + 1])
check2 = check_kaibun(s[right_center:])

if (check0 == True) and (check1 == True) and (check2 == True): 
    print("Yes")
else:
    print("No")
n,k=map(int,input().split())
a = list(map(int,input().split()))
minus = [abs(a[i]) for i in range(n) if a[i] < 0][::-1]

plus = [a[i] for i in range(n) if a[i] >= 0]

min_ = 10**18

if len(plus) == 0:
  print(minus[k-1])
elif len(minus) == 0:
  print(plus[k-1])
elif len(plus) < len(minus):
  for i in range(min(k-1, len(plus))):
    min_ = min(min_, 2*plus[i]+minus[k-2-i], plus[i]+2*minus[k-2-i])
  if i == k-2 and i+1 < len(plus):
    i += 1
    min_ = min(min_, plus[i])
  print(min_)
else:
  for i in range(min(k-1, len(minus))):
    min_ = min(min_, 2*minus[i]+plus[k-2-i], minus[i]+2*plus[k-2-i])
  if i == k-2 and i+1 < len(minus):
    i += 1
    min_ = min(min_, minus[i])
  print(min_)  
  


### FIXED CODE ###

n,k=map(int,input().split())
a = list(map(int,input().split()))
minus = [0]+[abs(a[i]) for i in range(n) if a[i] < 0][::-1]

plus = [0]+[a[i] for i in range(n) if a[i] >= 0]

min_ = 10**18

if len(plus) == 1:
  print(minus[k])
elif len(minus) == 1:
  print(plus[k])
else:
  for i in range(min(k+1, len(plus))):
    if k-i < len(minus):
      min_ = min(min_, 2*plus[i]+minus[k-i], plus[i]+2*minus[k-i])
  print(min_)
# https://atcoder.jp/contests/s8pc-4/tasks/s8pc_4_b

from itertools import combinations

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

minc=10**12
for i in combinations(a,K):
    cost=0
    for j in range(1,K):
        costt=max(i[j-1]-i[j]+1,0)
        i[j]+=costt
        cost+=costt
    minc=min(cost,minc)

print(minc)


### FIXED CODE ###

# https://atcoder.jp/contests/s8pc-4/tasks/s8pc_4_b

from itertools import combinations

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

minc=10**12
ai=[i for i in range(N)]
for i in combinations(ai,K):
    ac=a[:]
    cost=0
    i=list(i)
    for j in range(1,K):
        costt=max(max(ac[:i[j]])-ac[i[j]]+1,0)
        ac[i[j]]+=costt
        cost+=costt
    minc=min(cost,minc)
print(minc)
def 解():
    sS = input().rstrip()
    dsS = set()
    for s in sS:
        if s not in dsS:
            dsS.add(s)
    iK = int(input())
    iL = len(sS)
    iC = 0
    for s in sorted(list(dsS)):
        sDic = set()
        indexes = []
        for i in range(iL):
            if sS[i] == s:
                indexes.append(i)
        if iK < iL // len(indexes):
            for i in indexes:
                for j in range(1,iK+1):
                    sDic.add(sS[i:i+j])
            aS = sorted(list(sDic))
            print(aS[iK -1])
            exit()
        for i in indexes:
            for j in range(1,iL -i+1):
                sDic.add(sS[i:i+j])
        aS = sorted(list(sDic))
        iLS = len(aS)
        if iC + iLS < iK:
            iC += iLS
            continue
        else:
            print(aS[iK -iC-1])
            exit()
解()


### FIXED CODE ###

def 解():
    sS = input().rstrip()
    dsS = set()
    for s in sS:
        if s not in dsS:
            dsS.add(s)
    iK = int(input())
    iL = len(sS)
    iC = 0
    for s in sorted(list(dsS)):
        sDic = set()
        indexes = []
        for i in range(iL):
            if sS[i] == s :
                if i != 0 and i != iL-1:
                    if sS[i-1] != s or sS[i+1] != s:
                        indexes.append(i)
                else:
                    indexes.append(i)
        if iK < iL :
            for i in indexes:
                for j in range(1,iK+1):
                    if i+j <= iL:
                        sDic.add(sS[i:i+j])
            aS = sorted(list(sDic))
            if iK <= len(aS) :
                print(aS[iK - iC -1])
                exit()
            else:
                iC += len(aS)
        else:
            for i in indexes:
                for j in range(1,iL -i+1):
                    sDic.add(sS[i:i+j])
            aS = sorted(list(sDic))
            iLS = len(aS)
            if iC + iLS < iK:
                iC += iLS
                continue
            else:
                print(aS[iK -iC-1])
                exit()
解()
import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
input=sys.stdin.readline
##from random import randint
##import numpy as np
##sys.setrecursionlimit(10**7)
mo=10**9+7
def cin():
    return map(int,sin().split())
def ain():            
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
##def gcd(a,b): 
##    if a == 0: 
##        return b 
##    return gcd(b % a, a)
prime1=[]
def SieveOfEratosthenes(n): #list of primes upto n
    global prime1
    prime1 = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime1[p] == True): 
            for i in range(p * p, n+1, p): 
                prime1[i] = False
        p += 1
    f=[]
    for p in range(2, n): 
        if prime1[p]: 
            f.append(p)
    return f

def lcm(a,b): 
    return (a*b) // math.gcd(a,b) 
for _ in range(1):
    n=inin()
    l=ain()
    f1,f2=0,0
    gc=l[0]
    d=dd(int)
	if(l.count(1)>0):gc=1
    else:
      for i in range(1,n):
        gc=math.gcd(gc,l[i])
    if(gc!=1):print("not coprime")
    else:
        lp=SieveOfEratosthenes(int(math.sqrt(max(l)))+2)
        for i in l:
          if(i!=1):
            for j in lp:
              if(i%j==0):
                if(d[j]==1):
                  f1=1
                  break
                d[j]=1
            if(f1):break
        if(f1):
            print("setwise coprime")
        else:
            print("pairwise coprime")
        
        
    
    
    

 
    
    
    
    
        
        
    
    
    
    


    




##def msb(n):n|=n>>1;n|=n>>2;n|=n>>4;n|=n>>8;n|=n>>16;n|=n>>32;n|=n>>64;return n-(n>>1) #2 ki power
##def pref(a,n,f):             
##    pre=[0]*n
##    if(f==0):         ##from beginning
##        pre[0]=a[0]
##        for i in range(1,n):
##            pre[i]=a[i]+pre[i-1]
##    else:              ##from end
##        pre[-1]=a[-1]
##        for i in range(n-2,-1,-1):
##            pre[i]=pre[i+1]+a[i]
##    return pre
##maxint=10**24 
##def kadane(a,size): 
##    max_so_far = -maxint - 1
##    max_ending_here = 0
##       
##    for i in range(0, size): 
##        max_ending_here = max_ending_here + a[i] 
##        if (max_so_far < max_ending_here): 
##            max_so_far = max_ending_here 
##  
##        if max_ending_here < 0: 
##            max_ending_here = 0   
##    return max_so_far
##def power(x, y):
##    if(y == 0):return 1
##    temp = power(x, int(y / 2))%mo
##    if (y % 2 == 0):return (temp * temp)%mo 
##    else:
##        if(y > 0):return (x * temp * temp)%mo 
##        else:return ((temp * temp)//x )%mo


### FIXED CODE ###

import math
N=int(input())
m=10**6+1
M=[0]*m
g=0
for i in map(int,input().split()):M[i]+=1;g=math.gcd(g,i)
if g>1:print('not coprime')
elif all(sum(M[i::i])<=1 for i in range(2,m)):print('pairwise coprime')
else:print('setwise coprime')
def s_gen():
    for x in S: 
        yield x
def t_gen():
    for x in T:
        yield x
        

N=int(input())
S=input()[:N]
T=input()[:N]
it=s_gen()
it2=t_gen()

print("".join([next(it)+next(it2) for _ in range(N)]))

### FIXED CODE ###

def s_gen():
    for x in S: 
        yield x
def t_gen():
    for x in T:
        yield x
        

N=int(input())
S,T=input().split()
S,T=S[:N],T[:N]

it=s_gen()
it2=t_gen()

print("".join([next(it)+next(it2) for _ in range(N)]))
N, M = input().split()
N = int(N)
M = int(M)
S = []
C = []
A = []
zero_flag = False
for m in range(M):
  s, c = input().split()
  s = int(s)
  c = int(c)
  S.append(s)
  C.append(c)
  if s == 2 and c == 0 and N == 2:
    A.append('0')
  elif s == 2 and c == 0 and N == 3:
    A.append('00')
  elif s == 3 and c == 0 and N == 3:
    A.append('0') 
  else:
  	A.append(str((10**(N-(s-1)-1)) * c))
  if s == 1 and c == 0 and N != 2:
    zero_flag = True
    
flag = False
for a1 in A:
  for a2 in A:
    if a1 != a2 and len(a1) == len(a2):
      if a1 != a2:
        flag = True

if zero_flag:
  print('-1')
elif flag:
  print('-1')
else:
  ans = list(set(A))
  sum_ans = 0
  for a in ans:
    sum_ans += int(a)
  if sum_ans < (10**(N-(s-1)-1)):
  	sum_ans = sum_ans + (10**(N-1)) 
  print(sum_ans)


### FIXED CODE ###

N, M = input().split()
N = int(N)
M = int(M)
S = []
C = []
A = []
zero_flag = False
for m in range(M):
  s, c = input().split()
  s = int(s)
  c = int(c)
  S.append(s)
  C.append(c)
  if s == 2 and c == 0 and N == 2:
    A.append('0')
  elif s == 2 and c == 0 and N == 3:
    A.append('00')
  elif s == 3 and c == 0 and N == 3:
    A.append('0') 
  else:
  	A.append(str((10**(N-(s-1)-1)) * c))
  if s == 1 and c == 0 and N != 1:
    zero_flag = True

flag = False
for a1 in A:
  for a2 in A:
    if a1 != a2 and len(a1) == len(a2):
      if a1 != a2:
        flag = True

if zero_flag:
  print(-1)
elif flag:
  print(-1)
else:
  ans = list(set(A))
  sum_ans = 0
  for a in ans:
    sum_ans += int(a)
  if sum_ans < (10**(N-1)) and N != 1:
  	sum_ans = sum_ans + (10**(N-1)) 
  print(sum_ans)
a,b = map(int,input().split())
     
    t = b//1000
     
    f = False
     
    for i in range(t//10+1):
        for j in range((t-i*10)//5+1):
            if a == t - i*9 - j*4 and t == i*10+j*5+(a-i-j)A and a-i-j>=0:
                f = True
                break
        if f:
            break
     
    if f:
        print(i,j,a-i-j)
    else:
        print(-1,-1,-1)

### FIXED CODE ###

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

t = b//1000

f = False

for i in range(t//10+1):
    for j in range((t-i*10)//5+1):
        if a == t - i*9 - j*4 and b == i*10000+j*5000+(a-i-j)*1000 and a-i-j>=0:
            f = True
            break
    if f:
        break

if f:
    print(i,j,a-i-j)
else:
    print(-1,-1,-1)
num1 = int(input())
num2 = int(input())

if num1 >= 2*num2:
    print(num1 - 2*num2)
else:
    print(0)

### FIXED CODE ###

num1,num2 = map(int,input().split())
if num1 >= 2*num2:
    print(num1 - 2*num2)
else:
    print('0')
import sys
sys.setrecursionlimit(100000)
n,m = [int(i) for i in input().split()]
a = {int(input()) for i in range(m)}
dp = {}
def stairs(step):
  if step in a:
    return 0
  if step == 1:
    return 1
  if step == 2:
    return stairs(step-1) + 1
  if step in dp.keys():
    return dp[step]
  else:
    dp[step] = stairs(step-1) + stairs(step-2)
    return dp[step]
print(int(stairs(n)%1000000007))

### FIXED CODE ###

n,m = [int(i) for i in input().split()]
a = {int(input()) for i in range(m)}
dp = {}
for step in range(1,n+1):
    if step in a:
        dp[step] = 0
        continue
    if step == 1:
        if step in a:
            dp[1] = 0
        else:
            dp[1] = 1
        continue
    if step == 2:
        if step in a:
            dp[2] = dp[1]
        else:
            dp[2] = dp[1] + 1
        continue
    dp[step] = dp[step-1] + dp[step-2]
print(int(dp[n]%1000000007))
a,b=2,1
for i in range(int(input()):
               a,b=b,(a+b)
print(a)

### FIXED CODE ###

a,b=2,1
for i in range(int(input())):
  a,b=b,(a+b)
print(a)
L,R = map(int,input().split())

ans = 0
min_mod = 2019

if R-L+1<2019 :
  if R % 2019 > 0:
    if R-L == 0:
      min_mod = (L*R) % 2019
    else :
      for i in range(L,R) :
        print(i)
        for j in range(i+1,R):
          if min_mod > (i*j) % 2019:
            min_mod = (i*j) % 2019

    ans = min_mod
    
print(ans)

### FIXED CODE ###

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

print(min(n*a,b))
N = int(input())
A = list(map(int, input().split()))

A.sort()
M = 0
for i in range(N-1):
    M += abs(A[i])
M += A[N-1]
print(M)

nminus = len([i for i in A if i < 0])
nplus = N - nminus

if nplus == 0:
    caled = A[N]
    for i in range(N-1):
        print(caled,A[i])
        caled -= A[i]
elif nminus == 0:
    caled = A[0]
    for i in range(N-2):
        print(caled, A[i+1])
        caled -= A[i+1]
    print(A[N-1],caled)
else:
    caled = A[0]
    for i in range(nplus-1):
        print(caled,A[nminus+i])
        caled -= A[nminus+i]
    caled_2 = A[N-1]
    for i in range(nminus-1):
        print(caled_2,A[i+1])
    print(caled_2,caled)

### FIXED CODE ###

import numpy as np
N = int(input())
A = list(map(int, input().split()))

A.sort()

nminus = len([i for i in A if i < 0])
nplus = N - nminus



if nminus == N:
    M = 2*A[N-1] - np.sum(A)
    print(M)

    caled = A[N-1]
    for i in range(nminus-1):
        print(caled,A[i])
        caled -= A[i]
elif nplus == N:
    M = np.sum(A) - 2*A[0]
    print(M)

    caled = A[0]
    for i in range(N-2):
        print(caled, A[i+1])
        caled -= A[i+1]
    print(A[N-1],caled)
else:
    M = 0
    for i in range(N-1):
        M += abs(A[i])
    M += A[N-1]
    print(M)

    caled = A[0]
    for i in range(nplus-1):
        print(caled,A[nminus+i])
        caled -= A[nminus+i]
    caled_2 = A[N-1]
    for i in range(nminus-1):
        print(caled_2,A[i+1])
        caled_2 -= A[i+1]
    print(caled_2,caled)
r = int(input())
print(math.pi * (r ** 2), 2 * math.pi * r)


### FIXED CODE ###

import math
r = float(input())
print(math.pi * (r ** 2), 2 * math.pi * r)