#include <fstream>
#include <tuple>
using namespace std;
#define inFile "euclid3.in"
#define outFile "euclid3.out"
ifstream in(inFile);
ofstream out(outFile);
tuple < int, int, int > gcd(int a, int b) {
if(b == 0) return make_tuple(a, 1, 0);
tuple < int, int, int > gcdNext = gcd(b, a % b);
return make_tuple(get<0>(gcdNext),
get<2>(gcdNext),
get<1>(gcdNext) - (a / b) * get<2>(gcdNext));
}
int main() {
int testCase, a, b, c, x, y, d;
tuple < int, int, int > gcdRet;
in >> testCase;
while(testCase--) {
in >> a >> b >> c;
gcdRet = gcd(a, b);
d = get<0>(gcdRet);
x = get<1>(gcdRet);
y = get<2>(gcdRet);
if(a == 0 && b == 0) x = y = 0;
else if(c % d == 0) {
x *= (c / d);
y *= (c / d);
}
else {
x = 0;
y = 0;
}
out << x << " " << y << "\n";
}
return 0;
}