Harryxun/stf_run huggingface dataset:
P,Q,R = map(int,input().split())

a = P + Q
b = Q + R
c = R + P

if a > b and a > c:
  print('a')
elif b > c:
  print('b')
else
  print('c')

### FIXED CODE ###

P,Q,R = map(int,input().split())

a = P + Q
b = Q + R
c = R + P

if b > a and c > a:
  print(a)
elif b > c:
  print(c)
else:
  print(b)
N=int(input())
A=list(map(int, input()))
A.sort(reverse=True)
ans = 0
for i in range(N):
  if i%2==0:
    ans += A[i]
  else:
    ans -= A[i]
print(ans)


### FIXED CODE ###

N=int(input())
A=list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
for i in range(N):
  if i%2==0:
    ans += A[i]
  else:
    ans -= A[i]
print(ans)
N, Q = map(int, input().split())
S = input()
AClst = [] #ACのAを抜き出すリスト

for i in range(N-1):
  if S[i,i+2]=="A":
    AClst.append(1)
  else:
    AClst.append(0)

for q in range(Q):
  l, r = map(int, input().split())
  print(AClst[l:r].count(1))

### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
AClst = [0]
c = 0

for i in range(N-1):
  if S[i:i+2]=="AC":
    c += 1
  AClst.append(c)

for q in range(Q):
  l, r = map(int, input().split())
  print(AClst[r-1]-AClst[l-1])
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int main(){
  int N, T; cin >> N >> T;
  vector<int> c[N], t[N];
  for(int i = 0, i < N; ++i) {
    cin >> c[i] >> t[i];
  }
  int MAX = 1 << 30;
  int ans = MAX;

  for (int i = 0; i < N; ++i){
    if(t[i] <= T){
      ans = min(ans, c[i]);
      
    }
  }

  if (ans <  MAX){
    cout << ans << endl;
  }
  else {
    cout << "TLE" << endl;
  }
}

### FIXED CODE ###

n,T = map(int,input().split())
mn = 1001
for i in range(n):
    c,t = map(int,input().split())
    if t <= T:
        mn = min(mn,c)

if mn == 1001:
    print("TLE")
else :
    print(mn)
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, M = LI()
    pairs = []
    used = [0 for _ in range(N)]
    cur = 0
     
    for gap in range(1, M+1):
        while used[cur] or used[(cur + gap) % N]:
            cur += 1
        pairs.append((cur, cur + gap))
        used[cur] = 1
        used[cur+gap] = 1
    for p in pairs:
        print(p[0]+1, p[1]+1)



main()



### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, M = LI()
    used = [0 for _ in range(N)]
    cur = 0
    pairs = []
    used = set()
    if N % 2 == 0:
        a = 1
        b = N
        while len(pairs) < M:
            if b-a in used or N + a -b in used or b - a == N//2:
                b -= 1
            pairs.append((a, b))
            used.add(b-a)
            used.add(N+a - b)
            a += 1
            b -= 1

    else:
        a = 1
        b = N - 1
        while len(pairs) < M:
            pairs.append((a, b))
            a += 1
            b -= 1
    for p in pairs:
        print(p[0], p[1])



main()
N, K = map(int, input().split())
from operator import mul
from functools import reduce

def nCr(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

for j in range(K):
  if (2*j+1)>N:
    print(0)
  else:
    x = (nCr((K-1), j) * nCr(N-K+1, j+1))
    if (x > (10**9+7)):
         print(x%(10**9+7))
    else:
         print(x)
  

### FIXED CODE ###

N, K = map(int, input().split())
from operator import mul
from functools import reduce
 
def nCr(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
 
for j in range(K):
  if (K+j)>N:
    print(0)
  else:
    x = (nCr((K-1), j) * nCr(N-K+1, j+1))
    if (x > (10**9+7)):
         print(x%(10**9+7))
    else:
         print(x)
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [float("inf")]*n
dp[0] = 0
def chmin(a,b):
  if a>b:
    a = b
    return true
  else:
    return false
for i in range(n):
  for j in range(k):
    chmin(dp[i],dp[i-1]+abs(h[i]-h[i-j]))
print(dp[-1])

### FIXED CODE ###

def solve():
  n,k = map(int,input().split())
  h = list(map(int,input().split()))
  dp = [float("inf")]*n
  dp[0] = 0
  for i in range(0,n-1):
    for j in range(1,k+1):
      if (i-j)>=-1:
        dp[i+1]=min(dp[i+1],dp[i+1-j]+abs(h[i+1]-h[i+1-j]))
  print(dp[-1])
solve()
n,m = map(int,input().split())
s = list(input())
abli = [tuple(map(int,input().split())) for i in range(m)]

def addEdge(graph,u,v):
    graph[u].append(v)


def adjAB(graph,node):
    Aflag =False
    Bflag =False
    for i in graph[node]:
        if s[i-1]=='A':
            Aflag = True
        if s[i-1]=='B':
            Bflag = True
        if Aflag and Bflag:
            break
    if Aflag and Bflag:
        return(True)
    else:
        return(False)


def deleteNode(graph,node,s):
    graph.pop(node,None)
    s[node-1]='C'
    print(s)
        


from collections import defaultdict
graphAB = defaultdict(list)

for i,j in abli:
    addEdge(graphAB,i,j)
    if i != j:
        addEdge(graphAB,j,i)


flag = True

while flag:
    flag = False
    deletelist = []
    for i in graphAB:
        if not adjAB(graphAB,i):
            deletelist.append(i)
            flag = True
    for i in deletelist:
        deleteNode(graphAB,i,s)

print(graphAB)

if graphAB == {}:
    print('No')
else:
    print('Yes')





### FIXED CODE ###

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
GC027 C
"""

n,m = map(int,input().split())
s = list(input())
edges = [tuple(map(int,input().split())) for i in range(m)]
ali = [0 for i in range(n)]
bli = [0 for i in range(n)]


def addEdge(graph,u,v):
    graph[u].add(v)


from collections import defaultdict
graphAB = defaultdict(set)

def incrementAB(node,adj):
    if s[adj-1] == 'A':
        ali[node-1]+=1
    if s[adj-1] == 'B':
        bli[node-1]+=1

def decrementAB(node,adj):
    if s[adj-1] == 'A':
        ali[node-1]-=1
    if s[adj-1] == 'B':
        bli[node-1]-=1

for i,j in edges:
    addEdge(graphAB,i,j)
    addEdge(graphAB,j,i)

def adjAB(node):
    if ali[node-1]!=0 and bli[node-1]!=0:
        return(True)
    else:
        return(False)

graphvers = set(graphAB.keys())
visitset = set()
for i in range(1,n+1):
    if not i in graphvers:
        s[i-1] = 'C'
    else:
        for j in graphAB[i]:
            incrementAB(i,j)
        if not adjAB(i):
            visitset.add(i)


while bool(visitset):
    #print(graphAB)
    #print(graphABopp)
    #print(abli)
    i = visitset.pop()
    for j in graphAB[i]:
        if s[j-1] != 'C':
            decrementAB(j,i)
            if not adjAB(j):
                visitset.add(j)
    s[i-1] = 'C'

#print(graphAB)
#print(graphABopp)

sset= set(s)
sset.add('C')
sset.remove('C')
if bool(sset):
    print('Yes')
else:
    print('No')
i=0
while True:
    x=int(input())
    if(x==0) break
    print(f"Case {i}:{x}")
    i=i+1



### FIXED CODE ###

i=0
while True:
    x=int(input()) 
    if(x==0):
        break 
    i=i+1
    print(f"Case {i}: {x}")
from collections import defaultdict
n, m=map(int, input().split())
p=[int(s)-1 for s in input().split()]
pair=[[int(s)-1 for s in input().split()] for _ in range(m)]

avl=defaultdict(list)
for pi in pair:
    avl[pi[0]].append(pi[1])
    avl[pi[1]].append(pi[0])

def trv(src, dst, alr=[]):
    ans=False
    if src==dst or dst in avl[src]:
        return True
    for a in avl[src]:
        if a not in alr:
            alr.append(a)            
            ans|=trv(a, dst, alr)
    return ans

cnt=0
for i in range(n):
    if trv(p.index(i), i, []):
        cnt+=1
print(cnt)



### FIXED CODE ###

class UnionFind():
    def __init__(self,n):
        self.par=[i for i in range(n)]
    def root(self, x):
        if self.par[x]==x:
            return x
        else:
            self.par[x]=self.root(self.par[x])
            return self.par[x]
    def same(self,x,y):
        return self.root(x)==self.root(y)
    def unite(self,x,y):
        x=self.root(x)
        y=self.root(y)
        if x!=y:
            self.par[x]=y

n, m=map(int, input().split())
p=[int(s)-1 for s in input().split()]
pair=[[int(s)-1 for s in input().split()] for _ in range(m)]

uf=UnionFind(n)
for pi in pair:
    uf.unite(pi[0],pi[1])

cnt=0
for i, pi in enumerate(p):
    if uf.same(i,pi):
        cnt+=1
print(cnt)
n = int(input())
a = [int(x) for x in input().split()]
cnt = 0
for i in range(len(a)):
    if l == sorted(l):
        break
    for j in range(len(a)-1, i, -1):
        if a[j] < a[j-1]:
            a[j], a[j-1] = a[j-1], a[j]
        cnt += 1

print("YES" if cnt < 2 else "NO")

### FIXED CODE ###

n = int(input())
l = [int(x) for x in input().split()]
s_l = sorted(l)
print("YES" if sum([1 if l[i]!=s_l[i] else 0 for i in range(n)]) <= 2 else "NO")
S = input()
L = S.split()

a = L[0]
b = L[1]
c = L[2]

a = int(a)
b = int(b)
c = int(c)
l = [a,b,c]
    
min_1 = min(a,b,c)
# print l.remove(min_1)
l.remove(min_1)

min_2 = min(l)

l.remove(min_2)

min_3 = l[0]

min_1 = str(min_1)
min_2 = str(min_2)
min_3 = str(min_3)

print min_3+' '+min_2+' '+min_1

### FIXED CODE ###

S =raw_input()
L = S.split()

a = L[0]
b = L[1]
c = L[2]

a = int(a)
b = int(b)
c = int(c)
l = [a,b,c]
    
min_1 = min(a,b,c)
# print l.remove(min_1)
l.remove(min_1)

min_2 = min(l)

l.remove(min_2)

min_3 = l[0]

min_1 = str(min_1)
min_2 = str(min_2)
min_3 = str(min_3)

print min_1+' '+min_2+' '+min_3
N = int(input())
A = list(map(int, input().split()))
ans = 1
if 0 in A:
	print(0)
	exit()
for i in A:
	ans = ans * i
	if ans > pow(10, 18):
		print(-1)
		exit()
else:
	print(ans)

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
# 2019 6/9
# ABC129 C Typical Stairs
# fn: ways from 0 to n
# f(n) = f(n-1) + f(n-2)
# DP

import sys
sys.setrecursionlimit(100000)

dp = [-1] * 10005




CNT = 0
dp_list = [-1] * (100000 + 5)


def check_hole(M, broken_stairs):
    if len(broken_stairs) <= 1:
        return True
    for i in range(M - 1):
        if broken_stairs[i + 1] - broken_stairs[i] == 1:
            return False
    return True


def fib(n):
    global dp_list
    if n == 0 or n == 1 or n == 2:
        dp_list[0] = 0
        dp_list[1] = 1
        dp_list[2] = 2
        return dp_list[n]
    if dp_list[n] != -1:
        return dp_list[n]
    else:
        dp_list[n] = fib(n-1) + fib(n-2)
        return dp_list[n]


def count(broken_stairs, top_N, M):
    head = -1
    count_list = []
    if M == 1:
        count_list.append(broken_stairs[0] - 1)
        count_list.append(top_N - broken_stairs[0] - 1)
        return count_list
    else:
        for i in range(M):
            count_list.append(broken_stairs[i] - head - 2)
            head = broken_stairs[i]
        count_list.append(top_N - broken_stairs[-1] - 1)
        return count_list


def find_ans(broken_stairs, top_N, M):
    global CNT
    tmp = 1
    holes = count(broken_stairs, top_N, M)
    print('holes', holes)
    for i in holes:
        if i == 0:
            i = 1
        tmp *= fib(i)
    return tmp


if __name__ == '__main__':
    N, M = list(map(int, input().split()))
    broken_stairs = []
    for i in range(M):
        broken_stairs.append(int(input()))

    if M == 0:
        print(fib(N) / 1000000007)
        sys.exit()
    able = check_hole(M, broken_stairs)
    if not able:
        print(0)
    else:
        ans = find_ans(broken_stairs, N, M)
        print(dp_list[:10])
        print(ans % 1000000007)


### FIXED CODE ###

import sys

n, m = list(map(int, input().split()))
if m > 0:
    aaa = set(map(int, sys.stdin))
else:
    aaa = set()
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1 if 1 not in aaa else 0
MOD = 10 ** 9 + 7

for i in range(2, n + 1):
    if i in aaa:
        continue
    dp[i] = (dp[i - 2] + dp[i - 1]) % MOD
print(dp[n])
T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?':
        if T[i - 1] == 'P':
            T[i] = 'D'
        elif T[i + 1] == '?':
            T[i] = 'P'
            T[i + 1] = 'D'
            i += 1
        else:
            T[i] = 'D'
        

TL=''.join(T)
print(TL)


### FIXED CODE ###

T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'
    print(T[i],end='')
k, n = map(int, input().split())
l = list(map(int, input().split()))
d = []
for i in range(n):
  if i+1<n:
    d.append(abs(l[i+1]-l[i]))
  else:
    if 0 in l:
      d.append(abs(k - l[i]))
    else:
      d.append(abs(k - l[i] + l[0])
print(sum(d)-max(d))

### FIXED CODE ###

k,n = map(int, input().split())
l = list(map(int, input().split()))
d = []
for i in range(n):
  if i + 1 < n:
    d.append(l[i+1]-l[i])
  else:
    if 0 in l:
      d.append(k - l[i])
    else:
      d.append(k - l[i] + l[0])
sum = sum(d)
a = []
for i in range(n):
  a.append(sum - d[i])
print(min(a))
from collections import defaultdict
from itertools import combinations

N = int(input())
balls = [tuple(map(int, input().split())) for _ in range(N)]
cnt = defaultdict(int)
for b1, b2 in combinations(balls, 2):
    cnt[(abs(b2[0] - b1[0]), abs(b2[1] - b1[1]))] += 1
_, n = max(cnt.items(), key=lambda x: x[1])
cost = N - n
print(cost)

### FIXED CODE ###

from collections import defaultdict
from itertools import permutations

N = int(input())
balls = [tuple(map(int, input().split())) for _ in range(N)]
if N == 1: print(1)
else:
    cnt = defaultdict(int)
    for b1, b2 in permutations(balls, 2):
        cnt[(b2[0] - b1[0], b2[1] - b1[1])] += 1
    _, n = max(cnt.items(), key=lambda x: x[1])
    cost = N - n
    print(cost)
n=int(input())
a=[]
b=[]
c=[]
d=[]
for i in range(n):
    A,B=int(input().split()[0]),int(input().split()[1])
    a.append(A)
    b.append(B)
    c.append(A+B)
    d.append(i)
d.sort(key=lambda x:c[x],reverse='True')
s1=0
s2=0
for i in range(n):
    s1+=a[i]
    if i%2==0:
        s2+=c[d[i]]
print(s1-s2)

### FIXED CODE ###

n=int(input())
a=[]
b=[]
c=[]
for i in range(n):
    s=input().split()
    A,B=int(s[0]),int(s[1])
    a.append(A)
    b.append(B)
    c.append(A+B)
c.sort(reverse=True)
s1=0
s2=0
for i in range(n):
    s1+=a[i]
    if i%2:
        s2+=c[i]
print(s1-s2)
from collections import defaultdict
N,M = list(map(int,input().split()))

edges = defaultdict(dict)

for i in range(M):
    L,R,D = list(map(int,input().split()))
    edges[ L - 1][R -1] = D
    edges[R - 1][L - 1] = -D


visited = [None] * N
place = [0] * N
inf = 10 ** 10


def walk(i):
    if visited[i]:
        return (i,i)
    visited[i] = True
    (n,m) = ( inf, -inf)
    for j,d in edges[i].items():
        if visited[j] and place[j] != place[i] + d:
            print("No")
            exit()
        place[j] = place[i] + d
        (x,y) = walk(j)
        (n,m) = (min(n,x),max(m,y))
    return (n,m)

for i in range(N):
    # 連結成分のminとmax
    (n,m) = walk(i)
    if m -n > 10 ** 9:
        print("No")
        exit()
print("Yes")

### FIXED CODE ###

from sys import exit, setrecursionlimit
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect
 
def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]
 
setrecursionlimit(1000000)
INF = 10**10
 
(N, M) = reads()
 
edges = [[] for _ in range(N)]
 
for _ in range(M):
    (L, R, D) = reads()
    (L, R) = (L-1, R-1)
    edges[L].append((R, D))
    edges[R].append((L, -D))
 
visited = [False] * N
place = [None] * N
 
def walk(i):
    if visited[i]:
        return (place[i], place[i])
    visited[i] = True
    (m, M) = (INF, -INF)
    for (j, d) in edges[i]:
        if visited[j] and place[j] != place[i] + d:
            # print("v = ", visited)
            # print("p = ", place)
            print("No")
            exit()
        place[j] = place[i] + d
        (x, y) = walk(j)
        (m, M) = (min(m, x), max(M, y))
    return (m, M)
 
for i in range(N):
    if not visited[i]:
        place[i] = 0
        (m, M) = walk(i)
        if M - m > 10**9:
            # print("(m, M) = ", (m, M))
            print("No")
            exit()
 
print("Yes")
#%%
n, k = map(int, input().split())
v = list(map(int, input().split()))
vv = v.copy()[::-1]
ans = 0

for i in range(0, min(n+1, k+1)):
    for j in range(0, min(n+1-i, k+1-i)):
        x = k - i - j
        tmp = v[:i] + vv[:j]
        tmp.sort()
        #print(tmp, i, j, x)
        t = 0
        for q in range(len(tmp)):
            if tmp[q] < 0 and (q+1) <= x:
                pass
            else:
                t += tmp[q]
        #print(t)
        ans = max(ans, t)
print(ans)

### FIXED CODE ###

#%%
n, k = map(int, input().split())
v = list(map(int, input().split()))
vv = v.copy()[::-1]
ans = 0

for i in range(0, min(n+1, k+1)):
    for j in range(0, min(n+1-i, k+1-i)):
        x = k - i - j
        tmp = v[:i] + vv[:j]
        tmp.sort()
        #print(tmp, i, j, x)
        t = 0
        for q in range(len(tmp)):
            if tmp[q] < 0 and (q+1) <= x:
                pass
            else:
                t += tmp[q]
        #print(t)
        ans = max(ans, t)
print(ans)
print(input[:3]+'8'+input[6:])

### FIXED CODE ###

s=input()
s=s[:3]+"8"+s[4:]
print(s)
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(n)]

res = 0
for p in a:
  if sum(i+j for i,j in zip(p,b)) + c > 0:
    res += 1
return res

### FIXED CODE ###

n, m, c = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(n)]

res = 0
for p in a:
  if sum(i*j for i,j in zip(p,b)) + c > 0:
    res += 1
print(res)
mod=10**9+7
def mod_combination(n, k, mod):
    def ext_gcd(a, b):
        if b == 0:return a, 1, 0
        else:d,x,y = ext_gcd(b,a%b);x-=(a//b)*y 
        return d,y,x
    p,q=1,1
    for i in range(n-k+1,n+1):
        p=(p*i)%mod
    for i in range(2,k+1):
        q=(q*i)%mod
    return int(p*(ext_gcd(q, mod)[1]%mod)%mod)


n,m,k=map(int,input().split())
print(((pow(m,2,mod)*cmb(n*m-2,k-2,mod)*sum((n-i)*i%mod for i in range(1,n))%mod)+pow(n,2,mod)*cmb(n*m-2,k-2,mod)*sum((m-i)*i%mod for i in range(1,m))%mod)%mod)

### FIXED CODE ###

mod=10**9+7
def mod_combination(n, k, mod):
    def ext_gcd(a, b):
        if b == 0:return a, 1, 0
        else:d,x,y = ext_gcd(b,a%b);x-=(a//b)*y 
        return d,y,x
    p,q=1,1
    for i in range(n-k+1,n+1):
        p=(p*i)%mod
    for i in range(2,k+1):
        q=(q*i)%mod
    return int(p*(ext_gcd(q, mod)[1]%mod)%mod)


n,m,k=map(int,input().split())
print(((pow(m,2,mod)*mod_combination(n*m-2,k-2,mod)*sum((n-i)*i%mod for i in range(1,n))%mod)+pow(n,2,mod)*mod_combination(n*m-2,k-2,mod)*sum((m-i)*i%mod for i in range(1,m))%mod)%mod)
list = input().split()
a = list[0]
b = list[1]

if a * b % 2 == 0:
  print(Even)
else:
  print(Odd)

### FIXED CODE ###

list = input().split()
a = int(list[0])
b = int(list[1])

if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
Asum = [0] * N
Bsum = [0] * M
res = [0]

for i in range(N-1):
    Asum[0] = A[0]
    Asum[i+1] = Asum[i] + A[i+1]
    if Asum[i+1] > K:
        Aend = i
        break    
for j in range(M-1):
    Bsum[0] = B[0]
    Bsum[j+1] = Bsum[j] + B[j+1]
    if Bsum[j+1] > K:
        Bend = j
        break


for k in range(N):
    for l in range(M):
        if (Asum[k] + Bsum[l]) > K:
            res.append(k+1+l-1+1)
            break
        elif (Asum[k] + Bsum[l]) == K:
            res.append(k+1+l+1)
            break
        elif l == j:
            res.append(k+1+l+1)
            break

print(max(res))

### FIXED CODE ###

n,m,k=map(int,input().split())
arr1=list(map(int,input().split()))
arr2=list(map(int,input().split()))
acum1=[0]
for i in range(n): #累積和ai,bjを求める
 acum1.append(acum1[-1]+arr1[i])
acum2=[0]
for i in range(m):
 acum2.append(acum2[-1]+arr2[i])
ans=0
j=m
for i in range(n+1):
 if acum1[i]>k: #ai>Kであれば、どのようにjを選んでもai+bj<=Kとなることはないので探索を終了する
   break
 while acum2[j]>k-acum1[i] and j>0: #各iについて、bj<=K-aiを満たす最大のjを求める
   j-=1
 ans=max(ans,i+j)
print(ans)
a = int(input())
b = int(input())

ab = a*b
if ab%2 == 0:
  print(Even)
else:
  print(Odd)

### FIXED CODE ###

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

if a*b%2 == 0:
  print("Even")
else:
  print("Odd")
from collections import defaultdict,Counter
n = int(input())
al = list(map(int, input().split()))

c_al  = Counter(al)

if n % 2 == 0 and 0 not in c_al.values():
    print(int(2**(n/2))%(10**9) + 7)
elif n % 2 != 0 and c_al[0] == 1:
    print(int(2 ** (n // 2))%(10**9) + 7)
else:
    print(0)

### FIXED CODE ###

from collections import Counter

n = int(input())
al = list(map(int, input().split()))

c_al = Counter(al)

if n % 2 == 0:
    for k,v in c_al.items():
        if v != 2:
            print(0)
            exit()
    print(pow(2, n // 2, 10 ** 9 + 7))

elif n % 2 != 0:
    for k, v in c_al.items():
        if k == 0:
            if v != 1:
                print(0)
                exit()
        elif v != 2:
            print(0)
            exit()
    print(pow(2, n // 2, 10 ** 9 + 7))
Tap = input()
len_Tap = len(Tap)
count = 0

for i in range(len_Tap):
    if (i+1) % 2 == 1:
        if Tap[i] == 'R' or Tap[i] == 'U' or Tap[i] == 'D':
            count += 1
    
    else:
        if Tap[i] == 'L' or Tap[i] == 'U' or Tap[i] == 'D':
            count += 1

if count == len_Tap:
    print(Yes)

else:
    print(No)

### FIXED CODE ###

Tap = input()
len_Tap = len(Tap)
count = 0

for i in range(len_Tap):
    if (i+1) % 2 == 1:
        if Tap[i] == 'R' or Tap[i] == 'U' or Tap[i] == 'D':
            count += 1
    
    else:
        if Tap[i] == 'L' or Tap[i] == 'U' or Tap[i] == 'D':
            count += 1

if count == len_Tap:
    print('Yes')

else:
    print('No')
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a=b:
    print("YES")
    sys.exit()
if a<b and a+v*t>=b+w*t:
    print("YES")
elif a>b and a-v*t<b-w*t:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

import sys
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a==b:
    print("YES")
    sys.exit()
if a<b and a+v*t>=b+w*t:
    print("YES")
elif a>b and a-v*t<=b-w*t:
    print("YES")
else:
    print("NO")
%%time
N, Y = map(int,input().split())

ans = (-1, -1, -1)
for x in range(N+1):
    y_max = N - x
    if ans == (-1, -1, -1) and 0 <= Y - 10000*x <= 5000*y_max:
        for y in range(N+1):
            z = N - x - y
            if 10000*x + 5000*y + 1000*z == Y:
                ans = (x, y, z)
                break
print(' '.join(map(str,ans)))

### FIXED CODE ###

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

ans = (-1, -1, -1)
for x in range(N+1):
    if ans == (-1, -1, -1) and 0 <= Y - 10000*x <= 5000*(N-x):
        for y in range(N+1):
            z = N - x - y
            if 10000*x + 5000*y + 1000*z == Y:
                ans = (x, y, z)
                break

print(' '.join(map(str,ans)))