#include<iostream>
#include<algorithm>
#include<cstdio>
#include<utility>
#include<cstring>
#include<functional>
#include<queue>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 1e5;
const int INF = 0x7fffffff;
ll dis[maxn + 5], k;
pii edge[maxn + 5];
int a, b, c;
ll res[10];
void dijkstra() {
for (int i = 1; i <= c; ++i)dis[i] = INF;
priority_queue<pii, vector<pii>, greater<pii>> q;
q.push(pii(0, 0));
while (!q.empty()) {
pii u = q.top(); q.pop();
if (u.first > dis[u.second])continue;
if (dis[(u.second + a) % c] > dis[u.second] + a){
dis[(u.second + a) % c] = dis[u.second] + a;
edge[(u.second + a) % c] = pii(u.second, 1);
q.push(pii(dis[(u.second + a) % c], (u.second + a) % c));
}
if (dis[(u.second + b) % c] > dis[u.second] + b) {
dis[(u.second + b) % c] = dis[u.second] + b;
edge[(u.second + b) % c] = pii(u.second, 2);
q.push(pii(dis[(u.second + b) % c], (u.second + b) % c));
}
}
}
void dfs(int now) {
if (now == 0)return;
res[edge[now].second] += 1;
dfs(edge[now].first);
}
int main()
{
scanf("%d %d %d %lld", &a, &b, &c, &k);
dijkstra();
dfs(k % c);
ll sum = a * res[1] + b * res[2];
res[3] = (k - sum) / c;
printf("%lld %lld %lld
", res[1], res[2], res[3]);
return 0;
}