#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); i++)
#define int long long
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define all(x) x.begin(), x.end()
using pii = pair<int, int>;
using ll = long long;
const int INF = 1e9;

bool solve() {
    int a, b, d;
    cin >> a >> b >> d;
    if (a == 0 && b == 0 && d == 0) return false;
    int mx = 1e15;
    pii ans = {1e9, 1e9};
    REP(x, 50050) {
        if (x * a < d) continue;
        int rem = x * a - d;
        if (rem % b == 0) {
            int y = rem / b;
            if (x + y < ans.first + ans.second) {
                mx = a * x + b * y;
                ans = {x, y};
            } else if (x + y == ans.first + ans.second) {
                if (a * x + b * y < mx) {
                    mx = a * x + b * y;
                    ans = {x, y};
                }
            }
        }
    }
    REP(y, 50050) {
        if (y * b < d) continue;
        int rem = y * b - d;
        if (rem % a == 0) {
            int x = rem / a;
            if (x + y < ans.first + ans.second) {
                mx = a * x + b * y;
                ans = {x, y};
            } else if (x + y == ans.first + ans.second) {
                if (a * x + b * y < mx) {
                    mx = a * x + b * y;
                    ans = {x, y};
                }
            }
        }
    }
    REP(x, 50050) {
        int rem = d - x * a;
        if (rem < 0) break;
        if (rem % b == 0) {
            int y = rem / b;
            if (x + y < ans.first + ans.second) {
                mx = a * x + b * y;
                ans = {x, y};
            } else if (x + y == ans.first + ans.second) {
                if (a * x + b * y < mx) {
                    mx = a * x + b * y;
                    ans = {x, y};
                }
            }
        }
    }
    cout << ans.first << " " << ans.second << endl;
    return true;
}

signed main() {
    while (solve())
        ;
}

