n = int(input())
count_A = 0 # 300초
count_B = 0 # 60초
count_C = 0 # 10초
while n >= 300:
n = n - 300
count_A = count_A + 1
while n >= 60:
n = n - 60
count_B = count_B + 1
while n >= 10:
n = n - 10
count_C = count_C + 1
if n != 0:
print(-1)
else:
print("%d %d %d" %(count_A, count_B, count_C))