#include <bits/stdc++.h>
using namespace std;

int x,y,d,a,b,X[2],Y[2];

int main(){
	while(cin>>x>>y>>d,x||y||d){
		for(int i=0;i<2;i++){
			X[i]=0;Y[i]=0;
			i?a=d:a=0;i?b=0:b=d;
			while(a!=b){
				if(a<b){a+=x;X[i]++;} 
				else{b+=y;Y[i]++;}
			}
		}
		if(X[0]+Y[0]>X[1]+Y[1]||(X[0]+Y[0]==X[1]+Y[1]&&x*X[0]+y*Y[0]>x*X[1]+y*Y[1]))X[0]=X[1],Y[0]=Y[1];
		for(int i=0;i<100000;i++)if(d-i*x>=0&&(d-i*x)%y==0&&(X[0]+Y[0]>i+(d-i*x)/y||(X[0]+Y[0]==i+(d-i*x)/y&&x*X[0]+y*Y[0]>d)))X[0]=i,Y[0]=(d-i*x)/y;
		cout<<X[0]<<" "<<Y[0]<<endl;
	}
}