ans
배열에 횟수를 담아준다.buttons = [300, 60, 10] #5분, 1분, 10초
T = int(input())
ans = []
cnt = 0
if T % 10 != 0:
print(-1)
else:
for button in buttons:
cnt = T // button
ans.append(cnt)
T %= button
print(ans[0], ans[1], ans[2], sep = ' ')