#include <iostream>
#include <math.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int T;
cin >> T;
int A, B, C;
A = B = C = 0;
//5분 = 300초
A = T / 300;
T -= (300 * A);
//1분 = 60초
B = T / 60;
T -= (60 * B);
//10초
C = T / 10;
T -= (10 * C);
if (T == 0) cout << A<<" "<<B<<" "<<C;
else cout << -1;
return 0;
}