#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
#include <set>
#include <map>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

typedef pair<int,int> P;
int main() {
  int a, b, d;
  while(cin>>a>>b>>d, a) {
    vector<P> v;
    REP(i, b)
      if ((d+i*a)%b == 0)
        v.push_back(P(i, (d+i*a) / b));
    REP(i, a)
      if ((d+i*b)%a == 0)
        v.push_back(P((d+i*b) / a, i));
    
    for (int i = 0; i*a<=d ; i++)
      if ((d-i*a) % b == 0) {
        v.push_back(P(i, (d-i*a)/b));
      }
    P res = P(INF, INF);
    FOR(it, v) {
      if (res.first+res.second > it->first+it->second) {
        res = *it;
      } else if (res.first+res.second == it->first+it->second) {
        if (a*res.first+b*res.second > a*it->first+b*it->second)
          res = *it;
      }
    }
    cout << res.first << " " << res.second << endl;
  }
}