#include <iostream>

using namespace std;
typedef long long ll;

const ll INF = 1000000000000000ll;

bool compare(ll ax, ll ay, ll az, ll bx, ll by, ll bz){
	if(ax + ay < bx + by){ return true; }
	if(ax + ay > bx + by){ return false; }
	return az < bz;
}

int main(){
	while(true){
		ll a, b, d;
		cin >> a >> b >> d;
		if(a == 0 && b == 0 && d == 0){ break; }
		ll ax = INF, ay = INF, az = INF;
		for(ll i = 0; i <= 1000000; ++i){
			if(i * a <= d && (d - (i * a)) % b == 0){
				ll x = i, y = (d - (i * a)) / b, z = a * x + b * y;
				if(compare(x, y, z, ax, ay, az)){
					ax = x; ay = y; az = z;
				}
			}
			if(i * a >= d && (i * a - d) % b == 0){
				ll x = i, y = (i * a - d) / b, z = a * x + b * y;
				if(compare(x, y, z, ax, ay, az)){
					ax = x; ay = y; az = z;
				}
			}
			if((i * a + d) % b == 0){
				ll x = i, y = (i * a + d) / b, z = a * x + b * y;
				if(compare(x, y, z, ax, ay, az)){
					ax = x; ay = y; az = z;
				}
			}
		}
		cout << ax << " " << ay << endl;
	}
	return 0;
}