#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int a[N], cnt[N], t, tcnt[N];
void wrong_answer() {
    cout << -1 << endl;
    exit(0);
}
int ma;
bool check() {
    for(int i = 0; i <= ma; i++)
        if(cnt[i] != tcnt[i]) return false;
    return true;
}
int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> t;
    ma = 0;
    for(int i = 1; i <= t; i++) {
        cin >> a[i];
        cnt[a[i]]++;
        ma = max(ma, a[i]);
    }
    if(t == 1) {
        cout << 1 << " " << 1 << endl;
        cout << 1 << " " << 1 << endl;
        return 0;
    }
    if(cnt[0] != 1) {
        cout << -1 << endl;
        return 0;
    }
    int x = -1, y = -1;
    for(int i = 1; i < t; i++)
        if(cnt[i] != 4 * i && x == -1) {
            x = i;
            break;
        }
    //cout << x << " " << y << endl;
    for(int i = 1; i <= sqrt(t); i++) {
        if(t % i == 0) {
            int n = i, m = t / i;
            y = m + n - ma - x;
            //cout << n << " " << m << endl;
            //cout << x << " " << y << endl;
            memset(tcnt, 0, sizeof tcnt);
            for(int i = 1; i <= n; i++)
                for(int j = 1; j <= m; j++) {
                    tcnt[abs(i - x) + abs(j - y)]++;
                }
            if(check()) {
                cout << n << " " << m << endl;
                cout << x << " " << y << endl;
                return 0;
            }
            memset(tcnt, 0, sizeof tcnt);
            for(int i = 1; i <= m; i++)
                for(int j = 1; j <= n; j++) {
                    tcnt[abs(i - x) + abs(j - y)]++;
                }
            if(check()) {
                cout << m << " " << n << endl;
                cout << x << " " << y << endl;
                return 0;
            }
        }
    }
    cout << -1 << endl;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int a[N], cnt[N], t, tcnt[N];
void wrong_answer() {
    cout << -1 << endl;
    exit(0);
}
int ma;
bool check() {
    for(int i = 0; i <= ma; i++)
        if(cnt[i] != tcnt[i]) return false;
    return true;
}
int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> t;
    ma = 0;
    for(int i = 1; i <= t; i++) {
        cin >> a[i];
        cnt[a[i]]++;
        ma = max(ma, a[i]);
    }
    if(t == 1) {
        cout << 1 << " " << 1 << endl;
        cout << 1 << " " << 1 << endl;
        return 0;
    }
    if(cnt[0] != 1) {
        cout << -1 << endl;
        return 0;
    }
    int x = -1, y = -1;
    for(int i = 1; i < t; i++)
        if(cnt[i] != 4 * i && x == -1) {
            x = i;
            break;
        }
    //cout << x << " " << y << endl;
    for(int i = 1; i <= sqrt(t); i++) {
        if(t % i == 0) {
            int n = i, m = t / i;
            y = m + n - ma - x;
            //cout << n << " " << m << endl;
            //cout << x << " " << y << endl;
            memset(tcnt, 0, sizeof tcnt);
            for(int i = 1; i <= n; i++)
                for(int j = 1; j <= m; j++) {
                    tcnt[abs(i - x) + abs(j - y)]++;
                }
            if(check()) {
                cout << n << " " << m << endl;
                cout << x << " " << y << endl;
                return 0;
            }
            /*memset(tcnt, 0, sizeof tcnt);
            for(int i = 1; i <= m; i++)
                for(int j = 1; j <= n; j++) {
                    tcnt[abs(i - x) + abs(j - y)]++;
                }
            if(check()) {
                cout << m << " " << n << endl;
                cout << x << " " << y << endl;
                return 0;
            }*/
        }
    }
    cout << -1 << endl;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 5;
int a[N], cnt[N], t, tcnt[N];
void wrong_answer() {
    cout << -1 << endl;
    exit(0);
}
int ma;
bool check() {
    for(int i = 0; i <= ma; i++)
        if(cnt[i] != tcnt[i]) return false;
    return true;
}
int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> t;
    ma = 0;
    for(int i = 1; i <= t; i++) {
        cin >> a[i];
        cnt[a[i]]++;
        ma = max(ma, a[i]);
    }
    if(t == 1) {
        cout << 1 << " " << 1 << endl;
        cout << 1 << " " << 1 << endl;
        return 0;
    }
    if(cnt[0] != 1) {
        cout << -1 << endl;
        return 0;
    }
    int x = -1, y = -1;
    for(int i = 1; i < t; i++)
        if(cnt[i] != 4 * i && x == -1) {
            x = i;
            break;
        }
    //cout << x << " " << y << endl;
    for(int i = 1; i <= sqrt(t); i++) {
        if(t % i == 0) {
            int n = i, m = t / i;
            y = m + n - ma - x;
            //cout << n << " " << m << endl;
            //cout << x << " " << y << endl;
            memset(tcnt, 0, sizeof tcnt);
            for(int i = 1; i <= n; i++)
                for(int j = 1; j <= m; j++)
                    tcnt[abs(i - x) + abs(j - y)]++;
            if(check()) {
                cout << n << " " << m << endl;
                cout << x << " " << y << endl;
                return 0;
            }

            memset(tcnt, 0, sizeof tcnt);
            for(int i = 1; i <= m; i++)
                for(int j = 1; j <= n; j++)
                    tcnt[abs(i - x) + abs(j - y)]++;

            if(check()) {
                cout << m << " " << n << endl;
                cout << x << " " << y << endl;
                return 0;
            }
        }
    }
    cout << -1 << endl;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int a[N], cnt[N], t, tcnt[N];
void wrong_answer() {
    cout << -1 << endl;
    exit(0);
}
int ma;
bool check() {
    for(int i = 0; i <= ma; i++)
        if(cnt[i] != tcnt[i]) return false;
    return true;
}
int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> t;
    ma = 0;
    for(int i = 1; i <= t; i++) {
        cin >> a[i];
        cnt[a[i]]++;
        ma = max(ma, a[i]);
    }
    if(cnt[0] != 1) {
        cout << -1 << endl;
        return 0;
    }
    int x = -1, y = -1, ly = -1, ry = -1;
    for(int i = 1; i < t; i++) {
        if(cnt[i] != 4 * i && x == -1) {
            x = i;
        }
        if(x != -1 && cnt[i] <= 4 * i - 2 * (i - x) - 1) {
            y = i;
            break;
        }
    }
    //cout << x << " " << y << endl;
    for(int i = 1; i <= sqrt(t); i++) {
        if(t % i == 0) {
            int n = i, m = t / i;

            for(int ty = y; ty <= n / 2; ty++) {
                //cout << m << " " << n << endl;
                //cout << x << " " << ty << endl;
                memset(tcnt, 0, sizeof tcnt);
                for(int i = 1; i <= n; i++)
                    for(int j = 1; j <= m; j++) {
                        tcnt[abs(i - x) + abs(j - ty)]++;
                    }
                if(check()) {
                    cout << m << " " << n << endl;
                    cout << x << " " << ty << endl;
                    return 0;
                }
            }
            for(int ty = y; ty <= min(n, m / 2); ty++) {
                //cout << m << " " << n << endl;
                //cout << x << " " << ty << endl;
                memset(tcnt, 0, sizeof tcnt);
                for(int i = 1; i <= n; i++)
                    for(int j = 1; j <= m; j++) {
                        tcnt[abs(i - x) + abs(j - ty)]++;
                    }
                if(check()) {
                    cout << n << " " << m << endl;
                    cout << x << " " << ty << endl;
                    return 0;
                }
            }
        }
    }
    cout << -1 << endl;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int a[N], cnt[N], t, tcnt[N];
void wrong_answer() {
    cout << -1 << endl;
    exit(0);
}
int ma;
bool check() {
    for(int i = 0; i <= ma; i++)
        if(cnt[i] != tcnt[i]) return false;
    return true;
}
int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> t;
    ma = 0;
    for(int i = 1; i <= t; i++) {
        cin >> a[i];
        cnt[a[i]]++;
        ma = max(ma, a[i]);
    }
    if(cnt[0] != 1) {
        cout << -1 << endl;
        return 0;
    }
    int x = -1, y = -1, ly = -1, ry = -1;
    for(int i = 1; i < t; i++) {
        if(cnt[i] != 4 * i && x == -1) {
            x = i;
        }
        if(x != -1 && cnt[i] <= 4 * i - 2 * (i - x) - 1) {
            y = i;
            break;
        }
    }
    //cout << x << " " << y << endl;
    for(int i = 1; i <= sqrt(t); i++) {
        if(t % i == 0) {
            int n = i, m = t / i;

            for(int ty = y; ty <= n / 2; ty++) {
                //cout << m << " " << n << endl;
                //cout << x << " " << ty << endl;
                memset(tcnt, 0, sizeof tcnt);
                for(int i = 1; i <= n; i++)
                    for(int j = 1; j <= m; j++) {
                        tcnt[abs(i - x) + abs(j - ty)]++;
                    }
                if(check()) {
                    cout << m << " " << n << endl;
                    cout << x << " " << ty << endl;
                    return 0;
                }
            }
            for(int ty = y; ty <= m / 2; ty++) {
                //cout << m << " " << n << endl;
                //cout << x << " " << ty << endl;
                memset(tcnt, 0, sizeof tcnt);
                for(int i = 1; i <= n; i++)
                    for(int j = 1; j <= m; j++) {
                        tcnt[abs(i - x) + abs(j - ty)]++;
                    }
                if(check()) {
                    cout << n << " " << m << endl;
                    cout << x << " " << ty << endl;
                    return 0;
                }
            }
        }
    }
    cout << -1 << endl;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int a[N], cnt[N], t, tcnt[N];
void wrong_answer() {
    cout << -1 << endl;
    exit(0);
}
int ma;
bool check() {
    for(int i = 0; i <= ma; i++)
        if(cnt[i] != tcnt[i]) return false;
    return true;
}
int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> t;
    ma = 0;
    for(int i = 1; i <= t; i++) {
        cin >> a[i];
        cnt[a[i]]++;
        ma = max(ma, a[i]);
    }
    if(t == 1) {
        cout << 1 << " " << 1 << endl;
        cout << 1 << " " << 1 << endl;
        return 0;
    }
    if(cnt[0] != 1) {
        cout << -1 << endl;
        return 0;
    }
    int x = -1, y = -1;
    for(int i = 1; i < t; i++)
        if(cnt[i] != 4 * i && x == -1) {
            x = i;
            break;
        }
    //cout << x << " " << y << endl;
    for(int i = 1; i <= sqrt(t); i++) {
        if(t % i == 0) {
            int n = i, m = t / i;
            y = m + n - ma - x;
            //cout << n << " " << m << endl;
            //cout << x << " " << y << endl;
            memset(tcnt, 0, sizeof tcnt);
            for(int i = 1; i <= n; i++)
                for(int j = 1; j <= m; j++)
                    tcnt[abs(i - x) + abs(j - y)]++;
            if(check()) {
                cout << n << " " << m << endl;
                cout << x << " " << y << endl;
                return 0;
            }

            memset(tcnt, 0, sizeof tcnt);
            for(int i = 1; i <= m; i++)
                for(int j = 1; j <= n; j++)
                    tcnt[abs(i - x) + abs(j - y)]++;

            if(check()) {
                cout << m << " " << n << endl;
                cout << x << " " << y << endl;
                return 0;
            }
        }
    }
    cout << -1 << endl;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int a[N], cnt[N], t, tcnt[N];
void wrong_answer() {
    cout << -1 << endl;
    exit(0);
}
int ma;
bool check() {
    for(int i = 0; i <= ma; i++)
        if(cnt[i] != tcnt[i]) return false;
    return true;
}
int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> t;
    ma = 0;
    for(int i = 1; i <= t; i++) {
        cin >> a[i];
        cnt[a[i]]++;
        ma = max(ma, a[i]);
    }
    if(cnt[0] != 1) {
        cout << -1 << endl;
        return 0;
    }
    int x = -1, y = -1;
    for(int i = 1; i < t; i++)
        if(cnt[i] != 4 * i && x == -1) {
            x = i;
            break;
        }
    //cout << x << " " << y << endl;
    for(int i = 1; i <= sqrt(t); i++) {
        if(t % i == 0) {
            int n = i, m = t / i;
            y = m + n - ma - x;
            //cout << n << " " << m << endl;
            //cout << x << " " << y << endl;
            memset(tcnt, 0, sizeof tcnt);
            for(int i = 1; i <= n; i++)
                for(int j = 1; j <= m; j++) {
                    tcnt[abs(i - x) + abs(j - y)]++;
                }
            if(check()) {
                cout << n << " " << m << endl;
                cout << x << " " << y << endl;
                return 0;
            }
        }
    }
    cout << -1 << endl;
}


#include<bits/stdc++.h>
using namespace std;
#define N 1000001
int t,n,m,mx,x,y,a,c[N],f[N];
bool check()
{
	memset(f,0,sizeof(f));
	for(int i=1;i<=n;i++)
	  for(int j=1;j<=m;j++)
	    f[abs(i-x)+abs(j-y)]++;
	for(int i=0;i<t;i++)
	  if(f[i]!=c[i])return false;
	return true;
}
int main()
{
	scanf("%d",&t);
	for(int i=1;i<=t;i++)
	  scanf("%d",&a),c[a]++;
	for(int i=1;i<=t;i++)
	  if(c[i]!=4*i){x=i;break;}
	for(int i=t;i>=0;i--)
	  if(c[i]){mx=i;break;}
	for(n=1;n*n<=t;n++)
	  if(t%n==0)
	    {
	    m=t/n,y=n+m-x-mx;
	    if(check())return printf("%d %d\n%d %d\n",n,m,x,y),0;
	    swap(x,y);
	    if(check())return printf("%d %d\n%d %d\n",n,m,x,y),0;
	    swap(x,y);
		}
	printf("-1\n");
	return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

ll gcd(ll a, ll b)
{
    ll c;
    while (b != 0)
    {
        c = a % b;
        a = b;
        b = c;
    }
    return a;
}

int main(void)
{
  long long A,B,C;
  cin>>A;
  cin>>B;
  cin>>C;
  long long  x,y;
  if(A==0)
  {
    if((-C)%B == 0)
    {
      x = 0;
      y = (-C)/B;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  else if(B==0)
  {
    if((-C)%A == 0)
    {
      x = (-C)/A;
      y = 0;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  else
  {
    if(C==0)
    {
      cout << 0<<' '<<0;
      return 0;
    }
    ll aA = A;
    ll aB = B;
    if(aA<0)aA = -A;
    if(aB<0)aB = -B;
    ll g = gcd(aA,aB);
    if((C % g)!=0)
    {
      cout << -1;
      return 0;
    }
    long long mod0,modn;
    long long result = -C;
    mod0 = result%B;
    modn = mod0;
    while(modn!=0)
    {
      result += A;
      modn = result%B;
//cout<<"result = "<<result;
      if(modn == mod0)break;

    }
    if(modn==0)
    {
      y = result / B;
      x = (-C -(y*B)) / A;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

ll gcd(ll a, ll b)
{
    ll c;
    while (b != 0)
    {
        c = a % b;
        a = b;
        b = c;
    }
    return a;
}

int main(void)
{
  long long A,B,C;
  cin>>A;
  cin>>B;
  cin>>C;
  long long  x,y;
  //A^2 + B^2 > 0�Ȃ̂ŁAA,B������0�ł��邱�Ƃ͂Ȃ�
  if(A==0)
  {
    if((-C)%B == 0)
    {
      x = 0;
      y = (-C)/B;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  else if(B==0)
  {
    if((-C)%A == 0)
    {
      x = (-C)/A;
      y = 0;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  else
  {
    if(C==0)
    {
      cout << 0<<' '<<0;
      return 0;
    }
    ll aA = A;
    ll aB = B;
    if(aA<0)aA = -A;//��Βl
    if(aB<0)aB = -B;//��Βl
    ll g = gcd(aA,aB);//�ő����
    if((C % g)!=0)
    {
      cout << -1;//C��A,B�̍ő���񐔂Ŋ���؂�Ȃ��Ƃ��͐������Ȃ�
      return 0;
    }
    A = A / g;
    B = B / g;
    C = C / g;
    //aAx + aBy  = 1�ƂȂ�x,y�����߂�
    int flag = 0;
    if(aB>aA)
    {
      swap(aA,aB);// aA>=aB�ƂȂ�悤�ɂ���
      flag =1;
    }
    // m = aA - (aB * d)
    //   = xm * aA + ym * aB
    // n = aB
    //   = xn * aA + yn *aB
    ll m = aA % aB;
    ll d = aA / aB;
    ll n = aB;
    ll xn,yn;
    ll xm,ym;
    if(m == 0)
    {
      if((C%B)==0)
      {
        x = 0;
        y = C / B;
        if(flag==1)swap(x,y);
        cout << x<<' '<<y;
      }
      else
        cout << -1;
      return 0;
    }
    xn = 0;
    yn = 1;
    xm = 1;
    ym = -d;
    while(m > 1)
    {
      // new_m = n - (m * new_d)
      ll new_m = n % m;
      ll new_d = n / m;
      ll new_xm = xn + xm*(-new_d);
      ll new_ym = yn + ym*(-new_d);
      xn = xm;
      yn = ym;
      xm = new_xm;
      ym = new_ym;
      n = m;
      m = new_m;
    }
    if(flag ==1)swap(xm,ym);
    if(A<0) xm = -xm;
    if(B<0) ym = -ym;
    xm = xm * (-C);
    ym = ym * (-C);
    cout << xm<<' '<<ym;
  }
  return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

ll gcd(ll a, ll b)
{
    ll c;
    while (b != 0)
    {
        c = a % b;
        a = b;
        b = c;
    }
    return a;
}

int main(void)
{
  long long A,B,C;
  cin>>A;
  cin>>B;
  cin>>C;
  long long  x,y;
  //A^2 + B^2 > 0�Ȃ̂ŁAA,B������0�ł��邱�Ƃ͂Ȃ�
  if(A==0)
  {
    if((-C)%B == 0)
    {
      x = 0;
      y = (-C)/B;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  else if(B==0)
  {
    if((-C)%A == 0)
    {
      x = (-C)/A;
      y = 0;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  else
  {
    if(C==0)
    {
      cout << 0<<' '<<0;
      return 0;
    }
    ll aA = A;
    ll aB = B;
    if(aA<0)aA = -A;//��Βl
    if(aB<0)aB = -B;//��Βl
    ll g = gcd(aA,aB);//�ő����
    if((C % g)!=0)
    {
      cout << -1;//C��A,B�̍ő���񐔂Ŋ���؂�Ȃ��Ƃ��͐������Ȃ�
      return 0;
    }
    A = A / g;
    B = B / g;
    C = C / g;
    //aAx + aBy  = 1�ƂȂ�x,y�����߂�
    int flag = 0;
    if(aB>aA)
    {
      swap(aA,aB);// aA>=aB�ƂȂ�悤�ɂ���
      flag =1;
    }
    // m = aA - (aB * d)
    //   = xm * aA + ym * aB
    // n = aB
    //   = xn * aA + yn *aB
    ll m = aA % aB;
    ll d = aA / aB;
    ll n = aB;
    ll xn,yn;
    ll xm,ym;
    if(m == 0)
    {
      if((C%B)==0)
      {
        x = 0;
        y = -(C / B);
        if(flag==1)swap(x,y);
        cout << x<<' '<<y;
      }
      else
        cout << -1;
      return 0;
    }
    xn = 0;
    yn = 1;
    xm = 1;
    ym = -d;
    while(m > 1)
    {
      // new_m = n - (m * new_d)
      ll new_m = n % m;
      ll new_d = n / m;
      ll new_xm = xn + xm*(-new_d);
      ll new_ym = yn + ym*(-new_d);
      xn = xm;
      yn = ym;
      xm = new_xm;
      ym = new_ym;
      n = m;
      m = new_m;
    }
    if(flag ==1)swap(xm,ym);
    if(A<0) xm = -xm;
    if(B<0) ym = -ym;
    xm = xm * (-C);
    ym = ym * (-C);
    cout << xm<<' '<<ym;
  }
  return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

int main(void)
{
  long long A,B,C;
  cin>>A;
  cin>>B;
  cin>>C;
  long long  x,y;
  if(A==0)
  {
    if((-C)%B == 0)
    {
      x = 0;
      y = (-C)/B;
      cout << x<<' '<<y<<endl;
    }
    else
      cout << -1<<endl;
  }
  else if(B==0)
  {
    if((-C)%A == 0)
    {
      x = (-C)/A;
      y = 0;
      cout << x<<' '<<y<<endl;
    }
    else
      cout << -1<<endl;
  }
  else
  {
    int flag = 0;
    if(B>A)
    {
      flag = 1;
      swap(A,B);
    }
    long long mod0,modn;
    long long result = -C;
    mod0 = result%B;
    modn = mod0;
    while(modn!=0)
    {
      result += A;
      modn = result%B;
cout<<"result = "<<result<<endl;
      if(modn == mod0)break;
    }
    if(modn==0)
    {
      y = result / B;
      x = (-C -(y*B)) / A;
      if(flag==1)
        swap(x,y);
      cout << x<<' '<<y<<endl;
    }
    else
      cout << -1<<endl;
  }
  return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

ll gcd(ll a, ll b)
{
    ll c;
    while (b != 0)
    {
        c = a % b;
        a = b;
        b = c;
    }
    return a;
}

int main(void)
{
  long long A,B,C;
  cin>>A;
  cin>>B;
  cin>>C;
  long long  x,y;
  if(A==0)
  {
    if((-C)%B == 0)
    {
      x = 0;
      y = (-C)/B;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  else if(B==0)
  {
    if((-C)%A == 0)
    {
      x = (-C)/A;
      y = 0;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  else
  {
    if(C==0)
    {
      cout << 0<<' '<<0;
      return 0;
    }
    ll aA = A;
    ll aB = B;
    if(aA<0)aA = -A;
    if(aB<0)aB = -B;
    ll g = gcd(aA,aB);
    if((C % g)!=0)
    {
      cout << -1;
      return 0;
    }
    A = A / g;
    B = B / g;
    C = C / g;
    //aAx + aBy  = 1�ƂȂ�x,y�����߂�
    int flag = 0;
    if(aB>aA)
    {
      swap(aA,aB);
      flag =1;
    }
    // m = aA - (aB * d)
    ll m = aA % aB;
    ll d = aA / aB;
    ll n = aB;
    ll xn,yn;
    ll xm,ym;
    xn = 0;
    yn = 1;
    xm = 1;
    ym = -d;
    while(m > 1)
    {
      // new_m = n - (m * new_d)
      ll new_m = n % m;
      ll new_d = n / m;
      ll new_xm = xn + xm*(-new_d);
      ll new_ym = yn + ym*(-new_d);
      xn = xm;
      yn = ym;
      xm = new_xm;
      ym = new_ym;
      n = m;
      m = new_m;
    }
    if(flag ==1)swap(xm,ym);
    if(A<0) xm = -xm;
    if(B<0) ym = -ym;
    xm = xm * (-C);
    ym = ym * (-C);
    cout << xm<<' '<<ym;
  }
  return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

ll gcd(ll a, ll b)
{
    ll c;
    while (b != 0)
    {
        c = a % b;
        a = b;
        b = c;
    }
    return a;
}

int main(void)
{
  long long A,B,C;
  cin>>A;
  cin>>B;
  cin>>C;
  long long  x,y;
  //A^2 + B^2 > 0�Ȃ̂ŁAA,B������0�ł��邱�Ƃ͂Ȃ�
  if(A==0)
  {
    if((-C)%B == 0)
    {
      x = 0;
      y = (-C)/B;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  else if(B==0)
  {
    if((-C)%A == 0)
    {
      x = (-C)/A;
      y = 0;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  else
  {
    if(C==0)
    {
      cout << 0<<' '<<0;
      return 0;
    }
    ll aA = A;
    ll aB = B;
    if(aA<0)aA = -A;//��Βl
    if(aB<0)aB = -B;//��Βl
    ll g = gcd(aA,aB);//�ő����
    if((C % g)!=0)
    {
      cout << -1;//C��A,B�̍ő���񐔂Ŋ���؂�Ȃ��Ƃ��͐������Ȃ�
      return 0;
    }
    A = A / g;
    B = B / g;
    C = C / g;
    //aAx + aBy  = 1�ƂȂ�x,y�����߂�
    int flag = 0;
    if(aB>aA)
    {
      swap(aA,aB);// aA>=aB�ƂȂ�悤�ɂ���
      flag =1;
    }
    // m = aA - (aB * d)
    //   = xm * aA + ym * aB
    // n = aB
    //   = xn * aA + yn *aB
    ll m = aA % aB;
    ll d = aA / aB;
    ll n = aB;
    ll xn,yn;
    ll xm,ym;
    if(m == 0)
    {
      if((C%B)==0)
      {
        x = 0;
        y = C / B;
        if(B<0) y = -y;
        if(flag==1)swap(x,y);
        cout << x<<' '<<y;
      }
      else
        cout << -1;
      return 0;
    }
    xn = 0;
    yn = 1;
    xm = 1;
    ym = -d;
    while(m > 1)
    {
      // new_m = n - (m * new_d)
      ll new_m = n % m;
      ll new_d = n / m;
      ll new_xm = xn + xm*(-new_d);
      ll new_ym = yn + ym*(-new_d);
      xn = xm;
      yn = ym;
      xm = new_xm;
      ym = new_ym;
      n = m;
      m = new_m;
    }
    if(flag ==1)swap(xm,ym);
    if(A<0) xm = -xm;
    if(B<0) ym = -ym;
    xm = xm * (-C);
    ym = ym * (-C);
    cout << xm<<' '<<ym;
  }
  return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

ll gcd(ll a, ll b)
{
    ll c;
    while (b != 0)
    {
        c = a % b;
        a = b;
        b = c;
    }
    return a;
}

int main(void)
{
  long long A,B,C;
  cin>>A;
  cin>>B;
  cin>>C;
  long long  x,y;
  if(A==0)
  {
    if((-C)%B == 0)
    {
      x = 0;
      y = (-C)/B;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  else if(B==0)
  {
    if((-C)%A == 0)
    {
      x = (-C)/A;
      y = 0;
      cout << x<<' '<<y;
    }
    else
      cout << -1;
  }
  else
  {
    if(C==0)
    {
      cout << 0<<' '<<0;
      return 0;
    }
    ll aA = A;
    ll aB = B;
    if(aA<0)aA = -A;
    if(aB<0)aB = -B;
    ll g = gcd(aA,aB);
    if((C % g)!=0)
    {
      cout << -1;
      return 0;
    }
    A = A / g;
    B = B / g;
    C = C / g;
    //aAx + aBy  = 1�ƂȂ�x,y�����߂�
    int flag = 0;
    if(aB>aA)
    {
      swap(aA,aB);
      flag =1;
    }
    // m = aA - (aB * d)
    ll m = aA % aB;
    ll d = aA / aB;
    ll n = aB;
    x = 1;
    y = -d;
    while(m > 1)
    {
      // new_m = aB - (m * new_d)
      ll new_m = n % m;
      ll new_d = n / m;
      x = x*(-new_d);
      y = y*(-new_d) + 1;
      n = m;
      m = new_m;
    }
    if(flag ==1)swap(x,y);
    if(A<0) x = -x;
    if(B<0) y = -y;
    x = x * (-C);
    y = y * (-C);
    cout << x<<' '<<y;
  }
  return 0;
}


#include <iostream>
using namespace std;

typedef long long ll;

void gcd(ll a,ll b,ll& d,ll& x,ll& y)
{
	if(!b){d=a;x=1;y=0;}
	else
	{
		gcd(b,a%b,d,y,x);
		y-=x*(a/b);
	}
}

int main(){
	ll a,b,c,d,x,y;
	while(cin>>a>>b>>c)
	{
		gcd(a,b,d,x,y);
		c=-c;
		if(c%d!=0)cout<<"-1\n";
		else
		{
			cout<<x*c/d<<" "<<y*c/d<<"\n";
		}

	}
	return 0；
}


#include <iostream>
using namespace std;

typedef long long ll;

void gcd(ll a,ll b,ll& d,ll& x,ll& y)
{
	if(!b){d=a;x=1;y=0;}
	else
	{
		gcd(b,a%b,d,y,x);
		y-=x*(a/b);
	}
}

int main(){
	ll a,b,c,d,x,y;
	while(cin>>a>>b>>c)
	{
		gcd(a,b,d,x,y);
		c=-c;
		if(c%d!=0)cout<<"-1\n";
		else
		{
			cout<<x*c/d<<" "<<y*c/d<<"\n";
		}

	}
	cout<<a+b<<endl;
}


#include<cstdio>
int a,b,c,d;
long long x,y;
void exgcd(int a,int b,int &d,long long &x,long long &y){
	if(!b){
		d=a;
		x=1;
		y=0;
		return;
	}
	exgcd(b,a%b,d,y,x);
	y-=a/b*x;
}
int main()
{
	scanf("%d%d%d",&a,&b,&c);
	c=-c;
	exgcd(a,b,d,x,y);
	if(c%d)
		puts("-1");
	else
		printf("%I64d %I64d",c/d*x,c/d*y);
}


#include <iostream>
using namespace std;

typedef long long ll;

void gcd(ll a,ll b,ll& d,ll& x,ll& y)
{
	if(!b){d=a;x=1;y=0;}
	else
	{
		gcd(b,a%b,d,y,x);
		y-=x*(a/b);
	}
}

int main(){
	ll a,b,c,d,x,y;
	while(cin>>a>>b>>c)
	{
		gcd(a,b,d,x,y);
		c=-c;
		if(c%d!=0)cout<<"-1\n";
		else
		{
			cout<<x*c/d<<" "<<y*c/d<<"\n";
		}

	}
	return 0;
}


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

typedef long long ll;

void gcd(ll a,ll b,ll& d,ll& x,ll& y)
{
	if(!b){d=a;x=1;y=0;}
	else
	{
		gcd(b,a%b,d,y,x);
		y-=x*(a/b);
	}
}

int main(){
	ll a,b,c,d,x,y;
	while(cin>>a>>b>>c)
	{
		gcd(a,b,d,x,y);
		c=-c;
		if(c%d!=0)cout<<"-1\n";
		else
		{
			cout<<x*c/d<<" "<<y*c/d<<"\n";
		}

	}
	cout<<a+b<<endl;
}


/*
    ID : ping128
    LANG : C++
*/
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <math.h>
#include <algorithm>

#define INF (1<<30)

using namespace std;

typedef pair<int,int>PII;
typedef pair<PII,int>PII2;

// first four directions + four diagonal directions + itself
int cx[]={-1,0,0,1,-1,-1,1,1,0},cy[]={0,-1,1,0,-1,1,1,-1,0};

int stdout1 = 0;

int Test;
long long gcd;

long long GCD(long x,long y){
    if(x%y==0) return y;
    else return GCD(y,x%y);
}

long long extended_euclidean(long long a,long long b,long long *x,long long *y){
    if(b==0){
        *x = gcd;
        *y = 0;
    } else {
        long long xx,yy;
        extended_euclidean(b,a%b,&xx,&yy);
        *x = yy;
        *y = xx - (a / b) * yy;
    }
}

int main(){
    long long A,B,C,A1,B1,C1;

    scanf("%I64d %I64d %I64d",&A1,&B1,&C1);
    A = A1;
    B = B1;
    C = C1;
//    if(B%A==0 && C) printf("-1\n");
  //  else {
        gcd = GCD(A,B);
        if(C%gcd) printf("-1\n");
        else {
            B /= gcd;
            C %= A;
            C *= -1;
            if(C < 0) C += A;
            C /= gcd;
            A /= gcd;

          //  printf("-- %I64d %I64d %I64d\n",B,C,A);

            long long x,y;
            extended_euclidean(B,A,&x,&y);
            x *= C;
            printf("%I64d %I64d\n",(-C1-B1*x)/A1,x);
        }
 //   }

return 0;
}


/*
    ID : ping128
    LANG : C++
*/
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <math.h>
#include <algorithm>

#define INF (1<<30)

using namespace std;

typedef pair<int,int>PII;
typedef pair<PII,int>PII2;

// first four directions + four diagonal directions + itself
int cx[]={-1,0,0,1,-1,-1,1,1,0},cy[]={0,-1,1,0,-1,1,1,-1,0};

int stdout1 = 0;

int Test;
long long gcd;

long long GCD(long x,long y){
    if(x%y==0) return y;
    else return GCD(y,x%y);
}

long long extended_euclidean(long long a,long long b,long long *x,long long *y){
    if(b==0){
        *x = 1;
        *y = 0;
    } else {
        long long xx,yy;
        extended_euclidean(b,a%b,&xx,&yy);
        *x = yy;
        *y = xx - (a / b) * yy;
    }
}

int main(){
    long long A,B,C,A1,B1,C1;

    scanf("%I64d %I64d %I64d",&A1,&B1,&C1);
    A = A1;
    B = B1;
    C = C1;
//    if(B%A==0 && C) printf("-1\n");
  //  else {
        gcd = GCD(A,B);
        if(C%gcd) printf("-1\n");
        else {
            B /= gcd;
            C %= A;
            C *= -1;
            if(C < 0) C += A;
            C /= gcd;
            A /= gcd;

          //  printf("-- %I64d %I64d %I64d\n",B,C,A);

            long long x,y;
            extended_euclidean(B,A,&x,&y);
            x *= C;
            printf("%I64d %I64d\n",(-C1-B1*x)/A1,x);
        }
 //   }

 //   while(1);

return 0;
}


/*
    ID : ping128
    LANG : C++
*/
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <math.h>
#include <algorithm>

#define INF (1<<30)

using namespace std;

typedef pair<int,int>PII;
typedef pair<PII,int>PII2;

// first four directions + four diagonal directions + itself
int cx[]={-1,0,0,1,-1,-1,1,1,0},cy[]={0,-1,1,0,-1,1,1,-1,0};

int stdout1 = 0;

long long gcd;

long long extended_euclidean(long long a,long long b,long long *x,long long *y){
    if(b==0){
        *x = 1;
        *y = 0;
        return a;
    } else {
        long long xx,yy,d;
        d = extended_euclidean(b,a%b,&xx,&yy);
        *x = yy;
        *y = xx - (a / b) * yy;
        return d;

    }
}

int main(){
    long long A,B,C;

    scanf("%I64d %I64d %I64d",&A,&B,&C);
    long long x,y,gcd;
    gcd = extended_euclidean(A,B,&x,&y);
    if(C%gcd == 0){
        long long z = -C / gcd;
        printf("%I64d %I64d\n",x*z,y*z);
    } else printf("-1\n");

return 0;
}


#include<stdio.h>
#include<math.h>

typedef long long lld;

lld a,b,c;

lld euclidean(lld a,lld b,lld *x,lld *y){
    if(b==0){
        *x=1;
        *y=0;
        return a;
    } else {
        lld xx,yy;
        lld z=euclidean(b,a%b,&xx,&yy);
        *x=yy;
        *y=xx-(a/b)*yy;
        return z;
    }
}
int main(){
    lld x,y;
    scanf("%lld %lld %lld",&a,&b,&c);
    lld dd=euclidean(b,a,&x,&y);
    if(c%dd==0){
        x*=-c;
        y=(-c-b*x)/a;
        printf("%lld %lld",y,x);
    }
    else printf("-1");
return 0;
}


/*
    ID : ping128
    LANG : C++
*/
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <math.h>
#include <algorithm>

#define INF (1<<30)

using namespace std;

typedef pair<int,int>PII;
typedef pair<PII,int>PII2;

// first four directions + four diagonal directions + itself
int cx[]={-1,0,0,1,-1,-1,1,1,0},cy[]={0,-1,1,0,-1,1,1,-1,0};

int stdout1 = 0;

int Test;
long long gcd;

long long GCD(long x,long y){
    if(x%y==0) return y;
    else return GCD(y,x%y);
}

long long extended_euclidean(long long a,long long b,long long *x,long long *y){
    if(b==0){
        *x = 1;
        *y = 0;
    } else {
        long long xx,yy;
        extended_euclidean(b,a%b,&xx,&yy);
        *x = yy;
        *y = xx - (a / b) * yy;
    }
}

int main(){
    long long A,B,C,A1,B1,C1;

    scanf("%I64d %I64d %I64d",&A1,&B1,&C1);
    A = A1;
    B = B1;
    C = C1;
//    if(B%A==0 && C) printf("-1\n");
  //  else {
        gcd = GCD(A,B);
        if(C%gcd) printf("-1\n");
        else {
            B /= gcd;
            C %= A;
            C *= -1;
            if(C < 0) C += A;
            C /= gcd;
            A /= gcd;

          //  printf("-- %I64d %I64d %I64d\n",B,C,A);

            long long x,y;
            extended_euclidean(B,A,&x,&y);
            x *= C;
            printf("%I64d %I64d\n",(-C1-B1*x)/A1,x);
        }
 //   }

    while(1);

return 0;
}


#include<stdio.h>
#include<math.h>

int a,b,c;

int euclidean(int a,int b,int *x,int *y){
    if(b==0){
        *x=1;
        *y=0;
        return a;
    } else {
        int xx,yy;
        int z=euclidean(b,a%b,&xx,&yy);
        *x=yy;
        *y=xx-(a/b)*yy;
        return z;
    }
}
int main(){
    int x,y;
    scanf("%d %d %d",&a,&b,&c);
    int dd=euclidean(b,a,&x,&y);
    if(c%dd==0){
        x*=-c;
        y=(-c-b*x)/a;
        printf("%d %d\n",y,x);
    }
    else printf("-1\n");

return 0;
}


#include<stdio.h>
#include<math.h>

typedef long long lld;

lld a,b,c;

lld euclidean(lld a,lld b,lld *x,lld *y){
    if(b==0){
        *x=1;
        *y=0;
        return a;
    } else {
        lld xx,yy;
        lld z=euclidean(b,a%b,&xx,&yy);
        *x=yy;
        *y=xx-(a/b)*yy;
        return z;
    }
}
int main(){
    lld x,y;
    scanf("%I64d %I64d %I64d",&a,&b,&c);
    lld dd=euclidean(b,a,&x,&y);
    if(c%dd==0){
        x*=-c;
        y=(-c-b*x)/a;
        printf("%I64d %I64d",y,x);
    }
    else printf("-1");

return 0;
}


/**
给出一个式子ax+by+c=0
求出(x,y)在点【-5*10……18  ，5*10……18】 之间的点
不存在输出-1
输入值范围a,b,c  [-2*10^9 , 2*10^9]
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn=5000000000000000000;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
int is(ll a,ll b)
{
    if(fabs(a)<=maxn&&fabs(b)<=maxn) return 1;
    return 0;
}
ll gcd_ex(ll a,ll b,ll *x,ll *y)
{
    //O(lgn)
    if(b==0)
    {
        *y=0;
        *x=1;
        return a;
    }
    ll r=gcd_ex(b,a%b,x,y);
    ll t=*x;
    *x=*y;
    *y=t-a/b*(*y);
    return r;		//gcd(a,b)的值
}

int main()
{
    ll a,b,c,x,y,flag1,flag2,gcdans,flag3;
    //freopen("in1.txt","r",stdin);
    //freopen("out1.txt","w",stdout);
    while(scanf("%I64d%I64d%I64d",&a,&b,&c)!=EOF)
    {
        flag3=flag1=flag2=1;
        if(a<b)
        {
            a=a+b;
            b=a-b;
            a=a-b;
            flag3=0;
        }
        gcdans=gcd(a,b);
        gcd_ex(a,b,&x,&y);/**在欧几里得里面a>b  1.扩展欧几里得也需要2.求出的x,y一定是整数点?*/
        if(c%gcdans==0)
        {
            x*=(-c)/gcdans;
            y*=(-c)/gcdans;
        }
        else
        {
            printf("-1\n");
            continue;
        }
        if(!is(x,y))
        {
            printf("-1\n");
            continue;
        }
        if(flag3) printf("%I64d %I64d\n",x,y);
        else printf("%I64d %I64d\n",y,x);
    }
    return 0;
}


/**
给出一个式子ax+by+c=0
求出(x,y)在点【-5*10……18  ，5*10……18】 之间的点
不存在输出-1
输入值范围a,b,c  [-2*10^9 , 2*10^9]
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn=5000000000000000000;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
int is(ll a,ll b)
{
    if(fabs(a)<=maxn&&fabs(b)<=maxn) return 1;
    return 0;
}
ll gcd_ex(ll a,ll b,ll *x,ll *y)
{
    //O(lgn)
    if(b==0)
    {
        *y=0;
        *x=1;
        return a;
    }
    ll r=gcd_ex(b,a%b,x,y);
    ll t=*x;
    *x=*y;
    *y=t-a/b*(*y);
    return r;		//gcd(a,b)的值
}

int main()
{
    ll a,b,c,x,y,flag1,flag2,gcdans,flag3;
    //freopen("in1.txt","r",stdin);
    //freopen("out1.txt","w",stdout);
    while(scanf("%I64d%I64d%I64d",&a,&b,&c)!=EOF)
    {
        flag3=flag1=flag2=1;
        if(a<0)
        {
            flag1=-1;
            a=-a;
        }
        if(b<0)
        {
            flag2=-1;
            b=-b;
        }
        if(a<b)
        {
            a=a+b;
            b=a-b;
            a=a-b;
            flag3=0;
        }
        gcdans=gcd(a,b);
        //printf("%I64d ",gcdans);
        gcd_ex(a,b,&x,&y);/**在欧几里得里面a>b  1.扩展欧几里得也需要2.求出的x,y一定是整数点?*/

        if(c%gcdans==0)
        {
            x*=flag1*(-c)/gcdans;
            y*=flag2*(-c)/gcdans;
        }
        else
        {
            printf("-1\n");
            continue;
        }
        if(!is(x,y))
        {
            printf("-1\n");
            continue;
        }
        if(flag3) printf("%I64d %I64d\n",x,y);
        else printf("%I64d %I64d\n",y,x);
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn=5000000000000000000;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
int is(ll a,ll b)
{
    if(fabs(a)<=maxn&&fabs(b)<=maxn) return 1;
    return 0;
}
ll gcd_ex(ll a,ll b,ll *x,ll *y)
{
    if(b==0)
    {
        *y=0;
        *x=1;
        return a;
    }
    ll r=gcd_ex(b,a%b,x,y);
    ll t=*x;
    *x=*y;
    *y=t-a/b*(*y);
    return r;
}

int main()
{
    ll a,b,c,x,y,gcdans;
    while(scanf("%I64d%I64d%I64d",&a,&b,&c)!=EOF)
    {
        gcdans=gcd(a,b);
        gcd_ex(a,b,&x,&y);
        if(c%gcdans==0)
        {
            x*=(-c)/gcdans;
            y*=(-c)/gcdans;
        }
        else
        {
            printf("-1\n");
            continue;
        }
        if(!is(x,y))
        {
            printf("-1\n");
            continue;
        }
        printf("%I64d %I64d\n",x,y);
    }
    return 0;
}
/**
ax+by=gcd(a,b)
令 -c/z=gcd(a,b); so  z=-c/gcd(a,b);
ax*z+by*z=-c
x/=z,y/=z;
*/


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn=5000000000000000000;
int is(ll a,ll b)
{
    if(fabs(a)<=maxn&&fabs(b)<=maxn) return 1;
    return 0;
}
ll gcd_ex(ll a,ll b,ll *x,ll *y)
{
    if(b==0)
    {
        *y=0;
        *x=1;
        return a;
    }
    ll r=gcd_ex(b,a%b,x,y);
    ll t=*x;
    *x=*y;
    *y=t-a/b*(*y);
    return r;
}

int main()
{
    ll a,b,c,x,y,gcdans,flag3;
    while(scanf("%I64d%I64d%I64d",&a,&b,&c)!=EOF)
    {
        flag3=1;
        if(a<b)
        {
            a=a+b;
            b=a-b;
            a=a-b;
            flag3=0;
        }
        gcdans=gcd_ex(a,b,&x,&y);
        if(c%gcdans==0)
        {
            x*=(-c)/gcdans;
            y*=(-c)/gcdans;
        }
        else
        {
            printf("-1\n");
            continue;
        }
        if(!is(x,y))
        {
            printf("-1\n");
            continue;
        }
        if(flag3) printf("%I64d %I64d\n",x,y);
        else printf("%I64d %I64d\n",y,x);
    }
    return 0;
}


/**
给出一个式子ax+by+c=0
求出(x,y)在点【-5*10……18  ，5*10……18】 之间的点
不存在输出-1
输入值范围a,b,c  [-2*10^9 , 2*10^9]
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn=5000000000000000000;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
int is(ll a,ll b)
{
    if(fabs(a)<=maxn&&fabs(b)<=maxn) return 1;
    return 0;
}
ll gcd_ex(ll a,ll b,ll *x,ll *y)
{
    //O(lgn)
    if(b==0)
    {
        *y=0;
        *x=1;
        return a;
    }
    ll r=gcd_ex(b,a%b,x,y);
    ll t=*x;
    *x=*y;
    *y=t-a/b*(*y);
    return r;		//gcd(a,b)的值
}

int main()
{
    ll a,b,c,x,y,flag1,flag2,gcdans,flag3;
    //freopen("in1.txt","r",stdin);
    //freopen("out1.txt","w",stdout);
    while(scanf("%I64d%I64d%I64d",&a,&b,&c)!=EOF)
    {
        flag3=flag1=flag2=1;
        if(a<b)
        {
            a=a+b;
            b=a-b;
            a=a-b;
            flag3=0;
        }
        gcdans=gcd(a,b);
        gcd_ex(a,b,&x,&y);/**在欧几里得里面a>b  1.扩展欧几里得也需要2.求出的x,y一定是整数点?*/
        if(c%gcdans==0)
        {/**这边我原本是特判符号的。
            然后我的理由是
            ax+by=-c
            求出来的x>0 {a>0  x=x}{a<0 x=-x}
                    x<0  {a>0 x=x}{a<0 x=-x}
            */
            x*=(-c)/gcdans;
            y*=(-c)/gcdans;
        }
        else
        {
            printf("-1\n");
            continue;
        }
        if(!is(x,y))
        {
            printf("-1\n");
            continue;
        }
        if(flag3) printf("%I64d %I64d\n",x,y);
        else printf("%I64d %I64d\n",y,x);
    }
    return 0;
}
/**
ax+by=gcd(a,b)
令 -c/z=gcd(a,b); so  z=-c/gcd(a,b);
ax*z+by*z=-c
x/=z,y/=z;
*/


/**
给出一个式子ax+by+c=0
求出(x,y)在点【-5*10……18  ，5*10……18】 之间的点
不存在输出-1
输入值范围a,b,c  [-2*10^9 , 2*10^9]
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn=5000000000000000000;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
int is(ll a,ll b)
{
    if(fabs(a)<=maxn&&fabs(b)<=maxn) return 1;
    return 0;
}
ll gcd_ex(ll a,ll b,ll *x,ll *y)
{//O(lgn)
    if(b==0)
    {
        *y=0;
        *x=1;
        return a;
    }
    ll r=gcd_ex(b,a%b,x,y);
    ll t=*x;
    *x=*y;
    *y=t-a/b*(*y);
    return r;		//gcd(a,b)的值
}

int main()
{
    ll a,b,c,x,y,flag1,flag2,gcdans,flag3;
    freopen("in1.txt","r",stdin);
    freopen("out1.txt","w",stdout);
    while(scanf("%I64d%I64d%I64d",&a,&b,&c)!=EOF)
    {
        flag3=flag1=flag2=1;
        if(a<0) {flag1=-1;a=-a;}
        if(b<0) {flag2=-1;b=-b;}
        if(a<b) {a=a+b;b=a-b;a=a-b;flag3=0;}
        gcdans=gcd(a,b);
        gcd_ex(a,b,&x,&y);/**在欧几里得里面a>b  扩展欧几里得也需要*/
        x*=flag1*(-c)/gcdans;
        y*=flag2*(-c)/gcdans;
        if(!is(x,y)) {printf("-1\n");continue;}
        if(flag3) printf("%I64d %I64d\n",x,y);
        else printf("%I64d %I64d\n",y,x);
    }
    return 0;
}


/**
给出一个式子ax+by+c=0
求出(x,y)在点【-5*10……18  ，5*10……18】 之间的点
不存在输出-1
输入值范围a,b,c  [-2*10^9 , 2*10^9]
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn=5000000000000000000;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
int is(ll a,ll b)
{
    if(fabs(a)<=maxn&&fabs(b)<=maxn) return 1;
    return 0;
}
ll gcd_ex(ll a,ll b,ll *x,ll *y)
{//O(lgn)
    if(b==0)
    {
        *y=0;
        *x=1;
        return a;
    }
    ll r=gcd_ex(b,a%b,x,y);
    ll t=*x;
    *x=*y;
    *y=t-a/b*(*y);
    return r;		//gcd(a,b)的值
}

int main()
{
    ll a,b,c,x,y,flag1,flag2,gcdans,flag3;
    //freopen("in1.txt","r",stdin);
    //freopen("out1.txt","w",stdout);
    while(scanf("%I64d%I64d%I64d",&a,&b,&c)!=EOF)
    {
        flag3=flag1=flag2=1;
        if(a<0) {flag1=-1;a=-a;}
        if(b<0) {flag2=-1;b=-b;}
        if(a<b) {a=a+b;b=a-b;a=a-b;flag3=0;}
        gcdans=gcd(a,b);
        gcd_ex(a,b,&x,&y);/**在欧几里得里面a>b  扩展欧几里得也需要*/
        x*=flag1*(-c)/gcdans;
        y*=flag2*(-c)/gcdans;
        if(!is(x,y)) {printf("-1\n");continue;}
        if(flag3) printf("%I64d %I64d\n",x,y);
        else printf("%I64d %I64d\n",y,x);
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn=5000000000000000000;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
int is(ll a,ll b)
{
    if(fabs(a)<=maxn&&fabs(b)<=maxn) return 1;
    return 0;
}
ll gcd_ex(ll a,ll b,ll *x,ll *y)
{
    if(b==0)
    {
        *y=0;
        *x=1;
        return a;
    }
    ll r=gcd_ex(b,a%b,x,y);
    ll t=*x;
    *x=*y;
    *y=t-a/b*(*y);
    return r;
}

int main()
{
    ll a,b,c,x,y,gcdans;
    while(scanf("%I64d%I64d%I64d",&a,&b,&c)!=EOF)
    {
        gcdans=gcd(a,b);
        gcd_ex(a,b,&x,&y);
        if(c%gcdans==0)
        {
            x*=(-c)/gcdans;
            y*=(-c)/gcdans;
        }
        else
        {
            printf("-1\n");
            continue;
        }
        if(!is(x,y))
        {
            printf("-1\n");
            continue;
        }
        printf("%I64d %I64d\n",x,y);
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn=5000000000000000000;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
int is(ll a,ll b)
{
    if(fabs(a)<=maxn&&fabs(b)<=maxn) return 1;
    return 0;
}
ll gcd_ex(ll a,ll b,ll *x,ll *y)
{
    if(b==0)
    {
        *y=0;
        *x=1;
        return a;
    }
    ll r=gcd_ex(b,a%b,x,y);
    ll t=*x;
    *x=*y;
    *y=t-a/b*(*y);
    return r;
}

int main()
{
    ll a,b,c,x,y,gcdans;
    while(scanf("%I64d%I64d%I64d",&a,&b,&c)!=EOF)
    {
        gcdans=gcd(a,b);
        gcd_ex(a,b,&x,&y);
        if(c%gcdans==0)
        {
            x*=(-c)/gcdans;
            y*=(-c)/gcdans;
        }
        else
        {
            printf("-1\n");
            continue;
        }
        printf("%I64d %I64d\n",x,y);
    }
    return 0;
}


/**
给出一个式子ax+by+c=0
求出(x,y)在点【-5*10……18  ，5*10……18】 之间的点
不存在输出-1
输入值范围a,b,c  [-2*10^9 , 2*10^9]
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn=5000000000000000000;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
int is(ll a,ll b)
{
    if(fabs(a)<=maxn&&fabs(b)<=maxn) return 1;
    return 0;
}
ll gcd_ex(ll a,ll b,ll *x,ll *y)
{
    if(b==0)
    {
        *y=0;
        *x=1;
        return a;
    }
    ll r=gcd_ex(b,a%b,x,y);
    ll t=*x;
    *x=*y;
    *y=t-a/b*(*y);
    return r;		//gcd(a,b)的值
}

int main()
{
    ll a,b,c,x,y,flag1,flag2,gcdans,flag3;
    //freopen("in1.txt","r",stdin);
    //freopen("out1.txt","w",stdout);
    while(scanf("%I64d%I64d%I64d",&a,&b,&c)!=EOF)
    {
        gcdans=gcd(a,b);
        gcd_ex(a,b,&x,&y);
        if(c%gcdans==0)
        {
            x*=(-c)/gcdans;
            y*=(-c)/gcdans;
        }
        else
        {
            printf("-1\n");
            continue;
        }
        if(!is(x,y))
        {
            printf("-1\n");
            continue;
        }
        if(flag3) printf("%I64d %I64d\n",x,y);
        else printf("%I64d %I64d\n",y,x);
    }
    return 0;
}
/**
ax+by=gcd(a,b)
令 -c/z=gcd(a,b); so  z=-c/gcd(a,b);
ax*z+by*z=-c
x/=z,y/=z;
*/


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn=5000000000000000000;
int is(ll a,ll b)
{
    if(fabs(a)<=maxn&&fabs(b)<=maxn) return 1;
    return 0;
}
ll gcd_ex(ll a,ll b,ll *x,ll *y)
{
    if(b==0)
    {
        *y=0;
        *x=1;
        return a;
    }
    ll r=gcd_ex(b,a%b,x,y);
    ll t=*x;
    *x=*y;
    *y=t-a/b*(*y);
    return r;
}

int main()
{
    ll a,b,c,x,y,flag1,flag2,gcdans,flag3;
    while(scanf("%I64d%I64d%I64d",&a,&b,&c)!=EOF)
    {
        flag3=flag1=flag2=1;
        if(a<b)
        {
            a=a+b;
            b=a-b;
            a=a-b;
            flag3=0;
        }
        gcdans=gcd_ex(a,b,&x,&y);
        if(c%gcdans==0)
        {
            x*=(-c)/gcdans;
            y*=(-c)/gcdans;
        }
        else
        {
            printf("-1\n");
            continue;
        }
        if(!is(x,y))
        {
            printf("-1\n");
            continue;
        }
        if(flag3) printf("%I64d %I64d\n",x,y);
        else printf("%I64d %I64d\n",y,x);
    }
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll maxn=5000000000000000000;
int is(ll a,ll b)
{
    if(fabs(a)<=maxn&&fabs(b)<=maxn) return 1;
    return 0;
}
ll gcd_ex(ll a,ll b,ll *x,ll *y)
{
    if(b==0)
    {
        *y=0;
        *x=1;
        return a;
    }
    ll r=gcd_ex(b,a%b,x,y);
    ll t=*x;
    *x=*y;
    *y=t-a/b*(*y);
    return r;
}

int main()
{
    ll a,b,c,x,y,gcdans;
    while(scanf("%I64d%I64d%I64d",&a,&b,&c)!=EOF)
    {
        gcdans=gcd_ex(a,b,&x,&y);
        if(c%gcdans==0)
        {
            x*=(-c)/gcdans;
            y*=(-c)/gcdans;
        }
        else
        {
            printf("-1\n");
            continue;
        }
        if(!is(x,y))
        {
            printf("-1\n");
            continue;
        }
        printf("%I64d %I64d\n",x,y);
    }
    return 0;
}


#include <stdio.h>
#include <vector>
using namespace std;

long long a, b, c, f, g, h;

long long x, y, wynn;
void Euclid (long long a, long long b){
	long long x1=0, x2=1, y1=1, y2=0, q=a/b, r=a-q*b;
	x=1, y=y2-(q-1)*y1;
	while (r!=0){
		a=b, b=r;
		x=x2-q*x1, x2=x1, x1=x;
		y=y2-q*y1, y2=y1, y1=y;
		q=a/b, r=a-q*b;
	}
}

int main(){
	scanf ("%lld %lld %lld", &a, &b, &c);
	if (a==0){
		if (c%b==0)	printf ("%lld %lld\n", 0, -c/b);
		else printf ("-1\n");
	}

	else if (b==0){
		if (c%a==0)	printf ("%lld %lld\n", -c/a, 0);
		else printf ("-1\n");
	}

	else{
		Euclid(a, b);
		wynn=a*x+b*y;
		f=(b-c)%b;
		if (f<0)	f+=b;

		x=x%b;
		if (x<0)	x+=b;

		if ((f%wynn)!=0)	printf ("-1\n");
		else{
			g=(x*(f/wynn))%b;
			h=-(a*g+c)/b;
			printf ("%lld %lld\n", g, h);
		}
	}

return 0;}


#include <stdio.h>
#include <vector>
using namespace std;

long long a, b, c, f, g, h;

long long x, y, wynn;
void Euclid (long long a, long long b){
	long long x1=0, x2=1, y1=1, y2=0, q=a/b, r=a-q*b;
	x=1, y=y2-(q-1)*y1;
	while (r!=0){
		a=b, b=r;
		x=x2-q*x1, x2=x1, x1=x;
		y=y2-q*y1, y2=y1, y1=y;
		q=a/b, r=a-q*b;
	}
}

int main(){
	scanf ("%lld %lld %lld", &a, &b, &c);
	if (a==0){
		if (c%b==0)	printf ("0 %lld\n", 0, c/b*(-1));
		else printf ("-1\n");
	}

	else if (b==0){
		if (c%a==0)	printf ("%lld 0\n", c/a*(-1), 0);
		else printf ("-1\n");
	}

	else{
		Euclid(a, b);
		wynn=a*x+b*y;
		f=(b-c)%b;
		if (f<0)	f+=b;

		x=x%b;
		if (x<0)	x+=b;

		if ((f%wynn)!=0)	printf ("-1\n");
		else{
			g=(x*(f/wynn))%b;
			h=-(a*g+c)/b;
			printf ("%lld %lld\n", g, h);
		}
	}

return 0;}


#include <stdio.h>
#include <vector>
using namespace std;

long long a, b, c, f, g, h;

long long x, y, wynn;
void Euclid (long long a, long long b){
	long long x1=0, x2=1, y1=1, y2=0, q=a/b, r=a-q*b;
	x=1, y=y2-(q-1)*y1;
	while (r!=0){
		a=b, b=r;
		x=x2-q*x1, x2=x1, x1=x;
		y=y2-q*y1, y2=y1, y1=y;
		q=a/b, r=a-q*b;
	}
}

int main(){
	scanf ("%lld %lld %lld", &a, &b, &c);
	if (a==0){
		if (c%b==0)	printf ("%lld %lld\n", 0, -c/b);
		else printf ("-1\n");
	}

	else if (b==0){
		if (c%a==0)	printf ("%lld %lld\n", -c/a, 0);
		else printf ("-1\n");
	}

	else{
		Euclid(a, b);
		wynn=a*x+b*y;
		f=(b-c)%b;
		if (f<0)	f+=b;
		if ((f%wynn)!=0)	printf ("-1\n");
		else{
			g=(x*(f/wynn))%b;
			h=(a*x+c)/b;
			printf ("%lld %lld\n", g, h);
		}
	}

return 0;}


#include <stdio.h>
#include <vector>
using namespace std;

long long a, b, c, f, g, h;

long long x, y, wynn;
void Euclid (long long a, long long b){
	long long x1=0, x2=1, y1=1, y2=0, q=a/b, r=a-q*b;
	x=1, y=y2-(q-1)*y1;
	while (r!=0){
		a=b, b=r;
		x=x2-q*x1, x2=x1, x1=x;
		y=y2-q*y1, y2=y1, y1=y;
		q=a/b, r=a-q*b;
	}
}

int main(){
	scanf ("%lld %lld %lld", &a, &b, &c);
	if (a==0){
		if ((c%b)==0) printf ("0 %lld\n", -c/b);
		else printf ("-1\n");
	}

	else if (b==0){
		if (c%a==0)	printf ("%lld 0\n", -c/a);
		else printf ("-1\n");
	}

	else{
		Euclid(a, b);
		wynn=a*x+b*y;
		f=(b-c)%b;
		if (f<0)	f+=b;

		x=x%b;
		if (x<0)	x+=b;

		if ((f%wynn)!=0)	printf ("-1\n");
		else{
			g=(x*(f/wynn))%b;
			h=-(a*g+c)/b;
			printf ("%lld %lld\n", g, h);
		}
	}

return 0;}


#include <stdio.h>
#include <vector>
using namespace std;

long long a, b, c, f, g, h;

long long x, y, wynn;
void Euclid (long long a, long long b){
	long long x1=0, x2=1, y1=1, y2=0, q=a/b, r=a-q*b;
	x=1, y=y2-(q-1)*y1;
	while (r!=0){
		a=b, b=r;
		x=x2-q*x1, x2=x1, x1=x;
		y=y2-q*y1, y2=y1, y1=y;
		q=a/b, r=a-q*b;
	}
}

int main(){
	scanf ("%I64d %I64d %I64d", &a, &b, &c);
	if (a==0){
		if (c%b==0)	printf ("%I64d %I64d\n", 0, -c/b);
		else printf ("-1\n");
	}

	else if (b==0){
		if (c%a==0)	printf ("%I64d %I64d\n", -c/a, 0);
		else printf ("-1\n");
	}

	else{
		Euclid(a, b);
		wynn=a*x+b*y;
		f=(b-c)%b;
		if (f<0)	f+=b;

		x=x%b;
		if (x<0)	x+=b;

		if ((f%wynn)!=0)	printf ("-1\n");
		else{
			g=(x*(f/wynn))%b;
			h=-(a*g+c)/b;
			printf ("%I64d %I64d\n", g, h);
		}
	}

return 0;}


#include <iostream>
#include <algorithm>

using namespace std;

typedef long long LL;

LL e_gcd(LL a,LL b,LL &x,LL &y)
{
    if(b == 0){
        x = 1; y = 0;
        return a;
    }
    LL ans = e_gcd(b,a % b,x,y);
    LL temp = x;
    x = y;
    y = temp - a / b * y;
    return ans;
}

LL cal(LL a,LL b,LL c)
{
    LL x,y;
    LL gcd = e_gcd(a,b,x,y);
    if(c % gcd != 0)
        return -1;
    x *= c / gcd;
    b /= gcd;
    if(b < 0)   b = -b;
    LL ans = x % b;
    if(ans <= 0)    ans += b;
    return ans;
}

int main(void)
{
    int a,b,c;
    while(cin >> a >> b >> c){
        c = -c;
        if(b == 0)
        if(c % a == 0){
            cout << c / a << endl;
            continue;
        }
        else{
            cout << -1 << endl;
            continue;
        }
        LL x = cal(a,b,c);
        if(x == -1)
            cout << -1 << endl;
        else
            cout << x << " " << (c - x * a) / b << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

typedef long long LL;

LL e_gcd(LL a,LL b,LL &x,LL &y)
{
    if(b == 0){
        x = 1; y = 0;
        return a;
    }
    LL ans = e_gcd(b,a % b,x,y);
    LL temp = x;
    x = y;
    y = temp - a / b * y;
    return ans;
}

LL cal(LL a,LL b,LL c)
{
    LL x,y;
    LL gcd = e_gcd(a,b,x,y);
    if(c % gcd != 0)
        return -1;
    x *= c / gcd;
    b /= gcd;
    if(b < 0)   b = -b;
    LL ans = x % b;
    if(ans <= 0)    ans += b;
    return ans;
}

int main(void)
{
    int a,b,c;
    while(cin >> a >> b >> c){
        c = -c;
        LL x = cal(a,b,c);
        cout << x << " " << (c - x * a) / b << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

typedef long long LL;

LL e_gcd(LL a,LL b,LL &x,LL &y)
{
    if(b == 0){
        x = 1; y = 0;
        return a;
    }
    LL ans = e_gcd(b,a % b,x,y);
    LL temp = x;
    x = y;
    y = temp - a / b * y;
    return ans;
}

LL cal(LL a,LL b,LL c)
{
    LL x,y;
    LL gcd = e_gcd(a,b,x,y);
    if(c % gcd != 0)
        return -1;
    x *= c / gcd;
    b /= gcd;
    if(b < 0)   b = -b;
    LL ans = x % b;
    if(ans <= 0)    ans += b;
    return ans;
}

int main(void)
{
    int a,b,c;
    while(cin >> a >> b >> c){
        c = -c;
        LL x = cal(a,b,c);
        if(x == -1)
            cout << -1 << endl;
        else
            cout << x << " " << (c - x * a) / b << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

typedef long long LL;

LL e_gcd(LL a,LL b,LL &x,LL &y)
{
    if(b == 0){
        x = 1; y = 0;
        return a;
    }
    LL ans = e_gcd(b,a % b,x,y);
    LL temp = x;
    x = y;
    y = temp - a / b * y;
    return ans;
}

LL cal(LL a,LL b,LL c)
{
    LL x,y;
    LL gcd = e_gcd(a,b,x,y);
    if(c % gcd != 0)
        return -1;
    x *= c / gcd;
    b /= gcd;
    if(b < 0)   b = -b;
    LL ans = x % b;
    if(ans <= 0)    ans += b;
    return ans;
}

int main(void)
{
    int a,b,c;
    while(cin >> a >> b >> c){
        c = -c;
        if(a == 0){
            if(c % b == 0){
                cout << c / b << endl;
                continue;
            }
            else{
                cout << -1 << endl;
                continue;
            }
        }
        if(b == 0){
            if(c % a == 0){
                cout << c / b << endl;
                continue;
            }
            else{
                cout << -1 << endl;
                continue;
            }
        }
        LL x = cal(a,b,c);
        cout << x << " " << (c - x * a) / b << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

typedef long long LL;

LL e_gcd(LL a,LL b,LL &x,LL &y)
{
    if(b == 0){
        x = 1; y = 0;
        return a;
    }
    LL ans = e_gcd(b,a % b,x,y);
    LL temp = x;
    x = y;
    y = temp - a / b * y;
    return ans;
}

LL cal(LL a,LL b,LL c)
{
    LL x,y;
    LL gcd = e_gcd(a,b,x,y);
    if(c % gcd != 0)
        return -1;
    x *= c / gcd;
    b /= gcd;
    if(b < 0)   b = -b;
    LL ans = x % b;
    if(ans <= 0)    ans += b;
    return ans;
}

int main(void)
{
    int a,b,c;
    while(cin >> a >> b >> c){
        c = -c;
        if(b == 0)
        if(c % a == 0){
            cout << c / a << " " << 0 << endl;
            continue;
        }
        else{
            cout << -1 << endl;
            continue;
        }
        LL x = cal(a,b,c);
        if(x == -1)
            cout << -1 << endl;
        else
            cout << x << " " << (c - x * a) / b << endl;
    }
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker,"/STACK:16777216")
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#define FOR(i,a,n) for(int i=(a);i<(n);i++)
#define REP(i,n) FOR(i, 0, n)
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define lint long long
#define PII pair <int,int>
#define PDD pair <double,double>
#define VI vector <int>
#define VII vector < PII >
#define X first
#define Y second
#define sz(a) (int)(a.size())
using namespace std;

int a,b,c;
int gcd(int a,int b){
	if (a==0) return b;
	else return gcd(b%a,a);
}
int powmy(int a,int st,int mod){
	if (a<0) a+=mod;
	if (st==0) return 1;
	int res=powmy(a,st/2,mod);
	res=((lint)res*res)%mod;
	if (st&1) res=((lint)res*a)%mod;
	return res;
}
int main(){
	bool flag=false;
	scanf("%d%d%d",&a,&b,&c);
	int nod=gcd(abs(a),abs(b));
	if ((c%nod)!=0){
		printf("-1\n");
		return 0;
	}
	a/=nod;
	b/=nod;
	c/=nod;
	if (a==0){
		swap(a,b);
		flag=true;
	}
	if (a<0){
		a=-a;
		b=-b;
		c=-c;
	}
	lint x,y;
	if (a==1){
		y=0;
		x=-c;
	} else {
		y=((lint)-c*powmy(b,a-2,a))%a;
		//if (((-c-(lint)b*y)%a)!=0) while (1);
		x=(-c-(lint)b*y)/a;
	}
	if (flag) swap(x,y);
	cout << x << " " <<  y << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker,"/STACK:16777216")
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#define FOR(i,a,n) for(int i=(a);i<(n);i++)
#define REP(i,n) FOR(i, 0, n)
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define lint long long
#define PII pair <int,int>
#define PDD pair <double,double>
#define VI vector <int>
#define VII vector < PII >
#define X first
#define Y second
#define sz(a) (int)(a.size())
using namespace std;

int a,b,c;
lint x,y;
int gcd(int a,int b){
	if (a==0) return b;
	else return gcd(b%a,a);
}
int powmy(int a,int st,int mod){
	if (st==0) return 1;
	int res=powmy(a,st/2,mod);
	res=((lint)res*res)%mod;
	if (st&1) res=((lint)res*a)%mod;
	return res;
}
int fi(int n){
	int res=n;
	for (int i=2;i*i<=n;i++){
		if ((n%i)==0){
			while ((n%i)==0) n/=i;
			res=res-res/i;
		}
	}
	if (n>1) res=res-res/n;
	return res;
}
bool solve(){
	bool flag=false;
	int nod=gcd(abs(a),abs(b));
	if ((c%nod)!=0){
		printf("-1\n");
		return true;
	}
	a/=nod;
	b/=nod;
	c/=nod;
	if (a==0){
		swap(a,b);
		flag=true;
	}
	if (a<0){
		a=-a;
		b=-b;
		c=-c;
	}
	if (a==1){
		y=0;
		x=-c;
	} else {
		int pp=powmy(b,fi(a)-1,a);
		y=(-(lint)c*pp)%a;
		//if (((-c-(lint)b*y)%a)!=0) while (1);
		x=(-c-(lint)b*y)/a;
	}
	if (flag) swap(x,y);
	return false;
}
int main(){
	//while (1){
		scanf("%d%d%d",&a,&b,&c);
		/*if (a*a+b*b==0) continue;
		int a1=a,b1=b,c1=c;*/
		if (solve()) return 0;
		/*if (a1*x+b1*y+c1!=0){
			return 0;
		}*/
	//}
	cout << x << " " <<  y << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker,"/STACK:16777216")
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#define FOR(i,a,n) for(int i=(a);i<(n);i++)
#define REP(i,n) FOR(i, 0, n)
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define lint long long
#define PII pair <int,int>
#define PDD pair <double,double>
#define VI vector <int>
#define VII vector < PII >
#define X first
#define Y second
#define sz(a) (int)(a.size())
using namespace std;

int a,b,c;
int gcd(int a,int b){
	if (a==0) return b;
	else return gcd(b%a,a);
}
int powmy(int a,int st,int mod){
	if (st==0) return 1;
	int res=powmy(a,st/2,mod);
	res=((lint)res*res)%mod;
	if (st&1) res=((lint)res*a)%mod;
	return res;
}
int main(){
	bool flag=false;
	scanf("%d%d%d",&a,&b,&c);
	int nod=gcd(abs(a),abs(b));
	if ((c%nod)!=0){
		printf("-1\n");
		return 0;
	}
	a/=nod;
	b/=nod;
	c/=nod;
	if (a==0){
		swap(a,b);
		flag=true;
	}
	if (a<0){
		a=-a;
		b=-b;
		c=-c;
	}
	lint x,y;
	if (a==1){
		y=0;
		x=-c;
	} else {
		y=((lint)-c*powmy(b,a-2,a))%a;
		if (((-c-(lint)b*y)%a)!=0) while (1);
		x=(-c-(lint)b*y)/a;
	}
	if (flag) swap(x,y);
	cout << x << " " <<  y << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker,"/STACK:16777216")
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#define FOR(i,a,n) for(int i=(a);i<(n);i++)
#define REP(i,n) FOR(i, 0, n)
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define lint long long
#define PII pair <int,int>
#define PDD pair <double,double>
#define VI vector <int>
#define VII vector < PII >
#define X first
#define Y second
#define sz(a) (int)(a.size())
using namespace std;

int a,b,c;
int gcd(int a,int b){
	if (a==0) return b;
	else return gcd(b%a,a);
}
int powmy(int a,int st,int mod){
	if (st==0) return 1;
	int res=powmy(a,st/2,mod);
	res=((lint)res*res)%mod;
	if (st&1) res=((lint)res*a)%mod;
	return res;
}
int main(){
	bool flag=false;
	scanf("%d%d%d",&a,&b,&c);
	int nod=gcd(abs(a),abs(b));
	if ((c%nod)!=0){
		printf("-1\n");
		return 0;
	}
	a/=nod;
	b/=nod;
	c/=nod;
	if (a==0){
		swap(a,b);
		flag=true;
	}
	if (a<0){
		a=-a;
		b=-b;
		c=-c;
	}
	lint x,y;
	if (a==1){
		y=0;
		x=-c;
	} else {
		y=((lint)-c*powmy(b,a-2,a))%a;
		//if (((-c-(lint)b*y)%a)!=0) while (1);
		x=(-c-(lint)b*y)/a;
	}
	if (flag) swap(x,y);
	cout << x << " " <<  y << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker,"/STACK:16777216")
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#define FOR(i,a,n) for(int i=(a);i<(n);i++)
#define REP(i,n) FOR(i, 0, n)
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define lint long long
#define PII pair <int,int>
#define PDD pair <double,double>
#define VI vector <int>
#define VII vector < PII >
#define X first
#define Y second
#define sz(a) (int)(a.size())
using namespace std;

int a,b,c;
int gcd(int a,int b){
	if (a==0) return b;
	else return gcd(b%a,a);
}
int powmy(int a,int st,int mod){
	if (a<0) a+=mod;
	if (st==0) return 1;
	int res=powmy(a,st/2,mod);
	res=((lint)res*res)%mod;
	if (st&1) res=((lint)res*a)%mod;
	return res;
}
int main(){
	bool flag=false;
	scanf("%d%d%d",&a,&b,&c);
	int nod=gcd(abs(a),abs(b));
	if ((c%nod)!=0){
		printf("-1\n");
		return 0;
	}
	a/=nod;
	b/=nod;
	c/=nod;
	if (a==0){
		swap(a,b);
		flag=true;
	}
	if (a<0){
		a=-a;
		b=-b;
		c=-c;
	}
	lint x,y;
	if (a==1){
		y=0;
		x=-c;
	} else {
		y=(lint)-c*powmy(b,a-2,a);
		//if (((-c-(lint)b*y)%a)!=0) while (1);
		x=(-c-(lint)b*y)/a;
	}
	if (flag) swap(x,y);
	cout << x << " " <<  y << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker,"/STACK:16777216")
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#define FOR(i,a,n) for(int i=(a);i<(n);i++)
#define REP(i,n) FOR(i, 0, n)
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define lint long long
#define PII pair <int,int>
#define PDD pair <double,double>
#define VI vector <int>
#define VII vector < PII >
#define X first
#define Y second
#define sz(a) (int)(a.size())
using namespace std;

int a,b,c;
lint x,y;
int gcd(int a,int b){
	if (a==0) return b;
	else return gcd(b%a,a);
}
int powmy(int a,int st,int mod){
	if (st==0) return 1;
	int res=powmy(a,st/2,mod);
	res=((lint)res*res)%mod;
	if (st&1) res=((lint)res*a)%mod;
	return res;
}
int fi(int n){
	int res=n;
	for (int i=2;i*i<=n;i++){
		if ((n%i)==0){
			while ((n%i)==0) n/=i;
			res=res-res/i;
		}
	}
	if (n>1) res=res-res/n;
	return res;
}
void solve(){
	bool flag=false;
	int nod=gcd(abs(a),abs(b));
	if ((c%nod)!=0){
		printf("-1\n");
		return;
	}
	a/=nod;
	b/=nod;
	c/=nod;
	if (a==0){
		swap(a,b);
		flag=true;
	}
	if (a<0){
		a=-a;
		b=-b;
		c=-c;
	}
	if (a==1){
		y=0;
		x=-c;
	} else {
		int pp=powmy(b,fi(a)-1,a);
		y=(-(lint)c*pp)%a;
		//if (((-c-(lint)b*y)%a)!=0) while (1);
		x=(-c-(lint)b*y)/a;
	}
	if (flag) swap(x,y);
}
int main(){
	while (1){
		//scanf("%d%d%d",&a,&b,&c);
		a=rand()%100-50;
		b=rand()%100-50;
		c=rand()%100-50;
		if (a*a+b*b==0) continue;
		int a1=a,b1=b,c1=c;
		solve();
		if (a1*x+b1*y+c1!=0){
			return 0;
		}
	}
	cout << x << " " <<  y << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker,"/STACK:16777216")
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#define FOR(i,a,n) for(int i=(a);i<(n);i++)
#define REP(i,n) FOR(i, 0, n)
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define lint long long
#define PII pair <int,int>
#define PDD pair <double,double>
#define VI vector <int>
#define VII vector < PII >
#define X first
#define Y second
#define sz(a) (int)(a.size())
using namespace std;

int a,b,c;
int gcd(int a,int b){
	if (a==0) return b;
	else return gcd(b%a,a);
}
int powmy(int a,int st,int mod){
	if (st==0) return 1;
	int res=powmy(a,st/2,mod);
	res=((lint)res*res)%mod;
	if (st&1) res=((lint)res*a)%mod;
	return res;
}
int main(){
	bool flag=false;
	scanf("%d%d%d",&a,&b,&c);
	int nod=gcd(abs(a),abs(b));
	a/=nod;
	b/=nod;
	if (a==0){
		swap(a,b);
		flag=true;
	}
	if (a<0){
		a=-a;
		b=-b;
		c=-c;
	}
	lint x,y;
	if (a==1){
		y=0;
		x=-c;
	} else {
		y=((lint)-c*powmy(b,a-2,a))%a;
		x=(-c-(lint)b*y)/a;
	}
	if (flag) swap(x,y);
	cout << x << " " <<  y << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker,"/STACK:16777216")
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#define FOR(i,a,n) for(int i=(a);i<(n);i++)
#define REP(i,n) FOR(i, 0, n)
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define lint long long
#define PII pair <int,int>
#define PDD pair <double,double>
#define VI vector <int>
#define VII vector < PII >
#define X first
#define Y second
#define sz(a) (int)(a.size())
using namespace std;

int a,b,c;
lint x,y;
int gcd(int a,int b){
	if (a==0) return b;
	else return gcd(b%a,a);
}
int powmy(int a,int st,int mod){
	if (st==0) return 1;
	int res=powmy(a,st/2,mod);
	res=((lint)res*res)%mod;
	if (st&1) res=((lint)res*a)%mod;
	return res;
}
int fi(int n){
	int res=n;
	for (int i=2;i*i<=n;i++){
		if ((n%i)==0){
			while ((n%i)==0) n/=i;
			res=res-res/i;
		}
	}
	if (n>1) res=res-res/n;
	return res;
}
void solve(){
	bool flag=false;
	int nod=gcd(abs(a),abs(b));
	if ((c%nod)!=0){
		printf("-1\n");
		return;
	}
	a/=nod;
	b/=nod;
	c/=nod;
	if (a==0){
		swap(a,b);
		flag=true;
	}
	if (a<0){
		a=-a;
		b=-b;
		c=-c;
	}
	if (a==1){
		y=0;
		x=-c;
	} else {
		int pp=powmy(b,fi(a)-1,a);
		y=(-(lint)c*pp)%a;
		//if (((-c-(lint)b*y)%a)!=0) while (1);
		x=(-c-(lint)b*y)/a;
	}
	if (flag) swap(x,y);
}
int main(){
	//while (1){
		scanf("%d%d%d",&a,&b,&c);
		/*if (a*a+b*b==0) continue;
		int a1=a,b1=b,c1=c;*/
		solve();
		/*if (a1*x+b1*y+c1!=0){
			return 0;
		}*/
	//}
	cout << x << " " <<  y << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker,"/STACK:16777216")
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#define FOR(i,a,n) for(int i=(a);i<(n);i++)
#define REP(i,n) FOR(i, 0, n)
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define lint long long
#define PII pair <int,int>
#define PDD pair <double,double>
#define VI vector <int>
#define VII vector < PII >
#define X first
#define Y second
#define sz(a) (int)(a.size())
using namespace std;

int a,b,c;
int gcd(int a,int b){
	if (a==0) return b;
	else return gcd(b%a,a);
}
int powmy(int a,int st,int mod){
	if (st==0) return 1;
	int res=powmy(a,st/2,mod);
	res=((lint)res*res)%mod;
	if (st&1) res=((lint)res*a)%mod;
	return res;
}
int main(){
	bool flag=false;
	scanf("%d%d%d",&a,&b,&c);
	int nod=gcd(abs(a),abs(b));
	a/=nod;
	b/=nod;
	if (a==0){
		swap(a,b);
		flag=true;
	}
	if (a<0){
		a=-a;
		b=-b;
		c=-c;
	}
	lint x,y;
	if (a==1){
		y=0;
		x=-c;
	} else {
		y=((lint)-c*powmy(b,a-2,a))%a;
		if (((-c-(lint)b*y)%a)!=0) while (1);
		x=(-c-(lint)b*y)/a;
	}
	if (flag) swap(x,y);
	cout << x << " " <<  y << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker,"/STACK:16777216")
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#define FOR(i,a,n) for(int i=(a);i<(n);i++)
#define REP(i,n) FOR(i, 0, n)
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define lint long long
#define PII pair <int,int>
#define PDD pair <double,double>
#define VI vector <int>
#define VII vector < PII >
#define X first
#define Y second
#define sz(a) (int)(a.size())
using namespace std;

int a,b,c;
int gcd(int a,int b){
	if (a==0) return b;
	else return gcd(b%a,a);
}
int powmy(int a,int st,int mod){
	if (a<0) a+=mod;
	if (st==0) return 1;
	int res=powmy(a,st/2,mod);
	res=((lint)res*res)%mod;
	if (st&1) res=((lint)res*a)%mod;
	return res;
}
int main(){
	bool flag=false;
	scanf("%d%d%d",&a,&b,&c);
	int nod=gcd(abs(a),abs(b));
	if ((c%nod)!=0){
		printf("-1\n");
		return 0;
	}
	a/=nod;
	b/=nod;
	c/=nod;
	if (a==0){
		swap(a,b);
		flag=true;
	}
	if (a<0){
		a=-a;
		b=-b;
		c=-c;
	}
	lint x,y;
	if (a==1){
		y=0;
		x=-c;
	} else {
		y=(-(lint)c*powmy(b,a-2,a))%a;
		if (((-c-(lint)b*y)%a)!=0) while (1);
		x=(-c-(lint)b*y)/a;
	}
	if (flag) swap(x,y);
	cout << x << " " <<  y << endl;
	return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;

typedef long long ll;

struct Matrix
{
	ll m[5][5];
	Matrix()
	{
		memset(m,0,sizeof(m));
	}

	inline Matrix operator*(const Matrix b)
	{
		Matrix tmp;

		for(int i=1;i<=3;i++)
			for(int j=1;j<=2;j++)
				for(int k=1;k<=2;k++)
					tmp.m[i][j]+=m[i][k]*b.m[k][j];
		return tmp;
	}

	void Print()
	{
		for(int i=1;i<=3;i++,cout<<endl)
			for(int j=1;j<=2;j++)
				cout<<m[i][j]<<' ';
		cout<<endl;
	}
}A,I;

inline ll gcd(ll a,ll b)
{
	if(a<0)
		a=-a;
	if(b<0)
		b=-b;

	if(b>a)
		swap(a,b);

	if(b==0)
		return a;
	return gcd(b,a%b);
}

inline void Construct()
{
	I.m[1][1]=0;
	I.m[1][2]=1;
	I.m[2][1]=1;
	I.m[2][2]=-A.m[3][1]/A.m[3][2];
}

int main()
{
//	freopen("input.txt","r",stdin);
	ll a,b,c;
	cin>>a>>b>>c;

	bool fl=false;
	if(abs(a)<abs(b) || (abs(a)==abs(b) && a<b))
	{
		fl=true;
		swap(a,b);
	}
//	cout<<fl<<endl;
	if(b==0)
	{
		if(c%a==0)
			if(fl)
				cout<<0<<' '<<-c/a<<endl;
			else
				cout<<-c/a<<' '<<0<<endl;
		else
			cout<<-1<<endl;
		return 0;
	}

	ll GcdVal=gcd(a,b);
	if(c%GcdVal!=0)
	{
		cout<<-1<<endl;
		return 0;
	}

	if(a<0)
		GcdVal=-GcdVal;

	for(int i=1;i<=2;i++)
		A.m[i][i]=1;
	A.m[3][1]=a,A.m[3][2]=b;

//	A.Print();
	while(A.m[3][2]!=0)
	{
		Construct();
		A=A*I;
//		I.Print();
//		A.Print();
	}

	ll x=A.m[1][1],y=A.m[2][1];
	if(fl)
		swap(x,y);
	x=x*(-c/GcdVal),y=y*(-c/GcdVal);

	cout<<x<<' '<<y<<endl;

	return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;

typedef long long ll;

struct Matrix
{
	ll m[5][5];
	Matrix()
	{
		memset(m,0,sizeof(m));
	}

	inline Matrix operator*(const Matrix b)
	{
		Matrix tmp;

		for(int i=1;i<=3;i++)
			for(int j=1;j<=2;j++)
				for(int k=1;k<=2;k++)
					tmp.m[i][j]+=m[i][k]*b.m[k][j];
		return tmp;
	}

	void Print()
	{
		for(int i=1;i<=3;i++,cout<<endl)
			for(int j=1;j<=2;j++)
				cout<<m[i][j]<<' ';
		cout<<endl;
	}
}A,I;

inline ll gcd(ll a,ll b)
{
	if(a<0)
		a=-a;
	if(b<0)
		b=-b;

	if(b>a)
		swap(a,b);

	if(b==0)
		return a;
	return gcd(b,a%b);
}

inline void Construct()
{
	I.m[1][1]=0;
	I.m[1][2]=1;
	I.m[2][1]=1;
	I.m[2][2]=-A.m[3][1]/A.m[3][2];
}

int main()
{
//	freopen("input.txt","r",stdin);
	ll a,b,c;
	cin>>a>>b>>c;

	bool fl=false;
	if(abs(a)<abs(b))
	{
		fl=true;
		swap(a,b);
	}

	if(b==0)
	{
		if(c%a==0)
			if(fl)
				cout<<0<<' '<<-c/a<<endl;
			else
				cout<<-c/a<<' '<<0<<endl;
		else
			cout<<-1<<endl;
		return 0;
	}

	ll GcdVal=gcd(a,b);
	if(c%GcdVal!=0)
	{
		cout<<-1<<endl;
		return 0;
	}

	for(int i=1;i<=2;i++)
		A.m[i][i]=1;
	A.m[3][1]=abs(a),A.m[3][2]=abs(b);

	while(A.m[3][2]!=0)
	{
		Construct();
		A=A*I;
	}

	ll x=A.m[1][1],y=A.m[2][1];
	if(abs(a)!=a)
		x=-x;
	if(abs(b)!=b)
		y=-y;

	if(fl)
		swap(x,y);
	x=x*(-c/GcdVal),y=y*(-c/GcdVal);

	cout<<x<<' '<<y<<endl;

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

typedef long long ll;

inline ll extgcd(ll a,ll b,ll &x,ll &y)
{
	if(b==0)
	{
		x=1,y=0;// according to matrix 1 0
		        //                     0 1
		return a;
	}
	ll res=extgcd(b,a%b,x,y);
	ll tmp=x;
	x=y,y=tmp-x*(a/b);
	return res;
}

int main()
{
	ll a,b,c;
	cin>>a>>b>>c;
	ll x,y;
	ll val=extgcd(a,b,x,y);
	if(c%val!=0)
	{
		cout<<-1<<endl;
		return 0;
	}
	cout<<x*(-c/val)<<" "<<y*(-c/val)<<endl;
	return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;

typedef long long ll;

struct Matrix
{
	ll m[5][5];
	Matrix()
	{
		memset(m,0,sizeof(m));
	}

	inline Matrix operator*(const Matrix b)
	{
		Matrix tmp;

		for(int i=1;i<=3;i++)
			for(int j=1;j<=2;j++)
				for(int k=1;k<=2;k++)
					tmp.m[i][j]+=m[i][k]*b.m[k][j];
		return tmp;
	}

	void Print()
	{
		for(int i=1;i<=3;i++,cout<<endl)
			for(int j=1;j<=2;j++)
				cout<<m[i][j]<<' ';
		cout<<endl;
	}
}A,I;

inline ll gcd(ll a,ll b)
{
	if(a<0)
		a=-a;
	if(b<0)
		b=-b;

	if(b>a)
		swap(a,b);

	if(b==0)
		return a;
	return gcd(b,a%b);
}

inline void Construct()
{
	I.m[1][1]=0;
	I.m[1][2]=1;
	I.m[2][1]=1;
	I.m[2][2]=-A.m[3][1]/A.m[3][2];
}

int main()
{
//	freopen("input.txt","r",stdin);
	ll a,b,c;
	cin>>a>>b>>c;

	bool fl=false;
	if(abs(a)<abs(b) || (abs(a)==abs(b) && a<b))
	{
		fl=true;
		swap(a,b);
	}
//	cout<<fl<<endl;
	if(b==0)
	{
		if(c%a==0)
			if(fl)
				cout<<0<<' '<<-c/a<<endl;
			else
				cout<<-c/a<<' '<<0<<endl;
		else
			cout<<-1<<endl;
		return 0;
	}

	ll GcdVal=gcd(a,b);
	if(c%GcdVal!=0)
	{
		cout<<-1<<endl;
		return 0;
	}

	if(a<0 || b<0)
		GcdVal=-GcdVal;
	for(int i=1;i<=2;i++)
		A.m[i][i]=1;
	A.m[3][1]=a,A.m[3][2]=b;

//	A.Print();
	while(A.m[3][2]!=0)
	{
		Construct();
		A=A*I;
//		I.Print();
//		A.Print();
	}

	ll x=A.m[1][1],y=A.m[2][1];
	if(fl)
		swap(x,y);
	x=x*(-c/GcdVal),y=y*(-c/GcdVal);

	cout<<x<<' '<<y<<endl;

	return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;

typedef long long ll;

struct Matrix
{
	ll m[5][5];
	Matrix()
	{
		memset(m,0,sizeof(m));
	}

	inline Matrix operator*(const Matrix b)
	{
		Matrix tmp;

		for(int i=1;i<=3;i++)
			for(int j=1;j<=2;j++)
				for(int k=1;k<=2;k++)
					tmp.m[i][j]+=m[i][k]*b.m[k][j];
		return tmp;
	}

	void Print()
	{
		for(int i=1;i<=3;i++,cout<<endl)
			for(int j=1;j<=2;j++)
				cout<<m[i][j]<<' ';
		cout<<endl;
	}
}A,I;

inline ll gcd(ll a,ll b)
{
	if(a<0)
		a=-a;
	if(b<0)
		b=-b;

	if(b>a)
		swap(a,b);

	if(b==0)
		return a;
	return gcd(b,a%b);
}

inline void Construct()
{
	I.m[1][1]=0;
	I.m[1][2]=1;
	I.m[2][1]=1;
	I.m[2][2]=-A.m[3][1]/A.m[3][2];
}

int main()
{
//	freopen("input.txt","r",stdin);
	ll a,b,c;
	cin>>a>>b>>c;

	bool fl=false;
	if(abs(a)<abs(b) || (abs(a)==abs(b) && a>b))
	{
		fl=true;
		swap(a,b);
	}
//	cout<<fl<<endl;
	if(b==0)
	{
		if(c%a==0)
			if(fl)
				cout<<0<<' '<<-c/a<<endl;
			else
				cout<<-c/a<<' '<<0<<endl;
		else
			cout<<-1<<endl;
		return 0;
	}

	ll GcdVal=gcd(a,b);
	if(c%GcdVal!=0)
	{
		cout<<-1<<endl;
		return 0;
	}

	if(a<0)
		GcdVal=-GcdVal;

	for(int i=1;i<=2;i++)
		A.m[i][i]=1;
	A.m[3][1]=a,A.m[3][2]=b;

//	A.Print();
	while(A.m[3][2]!=0)
	{
		Construct();
		A=A*I;
//		I.Print();
//		A.Print();
	}
//	A.Print();

	ll x=A.m[1][1],y=A.m[2][1];
	if(abs(a)==abs(b) && a!=b)
	{
		if(x>0)
			x=-x;
		else
			y=-y;
	}
	if(fl)
		swap(x,y);
	x=x*(-c/GcdVal),y=y*(-c/GcdVal);

	cout<<x<<' '<<y<<endl;

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

typedef long long ll;

inline ll extgcd(ll a,ll b,ll &x,ll &y)
{
	if(b==0)
	{
		x=0,y=1;
		return a;
	}
	ll res=extgcd(b,a%b,x,y);
	ll tmp=x;
	x=y,y=x-a/b;
	return res;
}

int main()
{
	ll a,b,c;
	cin>>a>>b>>c;
	ll x,y;
	ll val=extgcd(a,b,x,y);
	if(c%val!=0)
	{
		cout<<-1<<endl;
		return 0;
	}
	cout<<x*(-c/val)<<" "<<y*(-c)/val<<endl;
	return 0;
}


//#pragma warning(disable:4786)
#include<iostream>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<ctime>
#include<string.h>
using namespace std;

#define pi acos(-1.0)
//#define LL __int64
typedef long long LL;
#define INF 0x7fffffffffffffff
#define bug puts("hear!")
#define inf 0x7fffffff
#define eps 1e-8
#define FRE freopen("in.txt","r",stdin)
#define E exp(1.0)
template<typename T>  T Gmax(T a,T b){return a>b?a:b;}
template<typename T>  T Gmin(T a,T b){return a<b?a:b;}
const int N=100005;

LL exgcd(LL a,LL b,LL &x,LL &y)
{
    if(b==0)
    {
        x=1;
        y=0;
        return a;
    }
    LL g=exgcd(b,a%b,x,y);
    LL temp=x;
    x=y;
    y=temp-(a/b)*y;
    return g;
}

int main()
{

    LL a,b,c,a1,b1,c1,x,y,d;
    while(cin>>a>>b>>c)
    {
        a1=abs(a),b1=abs(b),c1=abs(c);
        if(c==0)
        {
            printf("0 0\n");
            continue;
        }
        d=exgcd(a1,b1,x,y);
        if(c1%d!=0)
        {
            printf("-1\n");
            continue;
        }
        int qa=int(a<0)-int(a>0);
        int qb=int(b<0)-int(b>0);
        cout<<qa*x*c<<" "<<qb*y*c<<endl;
    }
    return 0;
}


//#pragma warning(disable:4786)
#include<iostream>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<ctime>
#include<string.h>
using namespace std;

#define pi acos(-1.0)
//#define LL __int64
typedef long long LL;
#define INF 0x7fffffffffffffff
#define bug puts("hear!")
#define inf 0x7fffffff
#define eps 1e-8
#define FRE freopen("in.txt","r",stdin)
#define E exp(1.0)
template<typename T>  T Gmax(T a,T b){return a>b?a:b;}
template<typename T>  T Gmin(T a,T b){return a<b?a:b;}
const int N=100005;

LL exgcd(LL a,LL b,LL &x,LL &y)
{
    if(b==0)
    {
        x=1;
        y=0;
        return a;
    }
    LL g=exgcd(b,a%b,x,y);
    LL temp=x;
    x=y;
    y=temp-(a/b)*y;
    return g;
}

int main()
{

    LL a,b,c,a1,b1,c1,x,y,d;
    while(cin>>a>>b>>c)
    {
        a1=abs(a),b1=abs(b),c1=abs(c);
        d=exgcd(a1,b1,x,y);
        if(c1%d!=0)
        {
            printf("-1\n");
            continue;
        }
        a1/=d,b1/=d,c1/=d;
        d=exgcd(a1,b1,x,y);
        LL qa=LL(a<0)-LL(a>0);
        LL qb=LL(b<0)-LL(b>0);
        cout<<qa*x*c<<" "<<qb*y*c<<endl;//已经转换成ax+by=1
    }
    return 0;
}


//#pragma warning(disable:4786)
#include<iostream>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<ctime>
#include<string.h>
using namespace std;

#define pi acos(-1.0)
//#define LL __int64
typedef long long LL;
#define INF 0x7fffffffffffffff
#define bug puts("hear!")
#define inf 0x7fffffff
#define eps 1e-8
#define FRE freopen("in.txt","r",stdin)
#define E exp(1.0)
template<typename T>  T Gmax(T a,T b){return a>b?a:b;}
template<typename T>  T Gmin(T a,T b){return a<b?a:b;}
const int N=100005;

LL myabs(LL a)
{
    return a>0?a:-a;
}

LL exgcd(LL a,LL b,LL &x,LL &y)
{
    if(b==0)
    {
        x=1;
        y=0;
        return a;
    }
    LL g=exgcd(b,a%b,x,y);
    LL temp=x;
    x=y;
    y=temp-(a/b)*y;
    return g;
}

int main()
{

    LL a,b,c,a1,b1,c1,x,y,d;
    while(cin>>a>>b>>c)
    {
        a1=myabs(a),b1=myabs(b),c1=myabs(c);
        d=exgcd(a1,b1,x,y);
        if(c1%d!=0)
        {
            printf("-1\n");
            continue;
        }
        LL qa=LL(a<0)-LL(a>0);
        LL qb=LL(b<0)-LL(b>0);
        cout<<qa*x*c<<" "<<qb*y*c<<endl;
    }
    return 0;
}


//#pragma warning(disable:4786)
#include<iostream>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<ctime>
#include<string.h>
using namespace std;

#define pi acos(-1.0)
//#define LL __int64
typedef long long LL;
#define INF 0x7fffffffffffffff
#define bug puts("hear!")
#define inf 0x7fffffff
#define eps 1e-8
#define FRE freopen("in.txt","r",stdin)
#define E exp(1.0)
template<typename T>  T Gmax(T a,T b){return a>b?a:b;}
template<typename T>  T Gmin(T a,T b){return a<b?a:b;}
const int N=100005;

LL myabs(LL a)
{
    return a>0?a:-a;
}

LL exgcd(LL a,LL b,LL &x,LL &y)
{
    if(b==0)
    {
        x=1;
        y=0;
        return a;
    }
    LL g=exgcd(b,a%b,x,y);
    LL temp=x;
    x=y;
    y=temp-(a/b)*y;
    return g;
}

int main()
{

    LL a,b,c,a1,b1,c1,x,y,d;
    while(cin>>a>>b>>c)
    {
        a1=myabs(a),b1=myabs(b),c1=myabs(c);
        d=exgcd(a1,b1,x,y);
        if(c1%d!=0)
        {
            printf("-1\n");
            continue;
        }
        LL qa=LL(a<0)-LL(a>0);
        LL qb=LL(b<0)-LL(b>0);
        cout<<qa*x*(c/d)<<" "<<qb*y*(c/d)<<endl;
    }
    return 0;
}


//#pragma warning(disable:4786)
#include<iostream>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<ctime>
#include<string.h>
using namespace std;

#define pi acos(-1.0)
//#define LL __int64
typedef long long LL;
#define INF 0x7fffffffffffffff
#define bug puts("hear!")
#define inf 0x7fffffff
#define eps 1e-8
#define FRE freopen("in.txt","r",stdin)
#define E exp(1.0)
template<typename T>  T Gmax(T a,T b){return a>b?a:b;}
template<typename T>  T Gmin(T a,T b){return a<b?a:b;}
const int N=100005;

LL exgcd(LL a,LL b,LL &x,LL &y)
{
    if(b==0)
    {
        x=1;
        y=0;
        return a;
    }
    LL g=exgcd(b,a%b,x,y);
    LL temp=x;
    x=y;
    y=temp-(a/b)*y;
    return g;
}

int main()
{

    LL a,b,c,a1,b1,c1,x,y,d;
    while(cin>>a>>b>>c)
    {
        a1=abs(a),b1=abs(b),c1=abs(c);
        d=exgcd(a1,b1,x,y);
        if(c1%d!=0)
        {
            printf("-1\n");
            continue;
        }
        a1/=d,b1/=d,c1/=d;
        LL qa=LL(a<0)-LL(a>0);
        LL qb=LL(b<0)-LL(b>0);
        cout<<qa*x*c<<" "<<qb*y*c<<endl;//已经转换成ax+by=1
    }
    return 0;
}


//#pragma warning(disable:4786)
#include<iostream>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<ctime>
#include<string.h>
using namespace std;

#define pi acos(-1.0)
//#define LL __int64
typedef long long LL;
#define INF 0x7fffffffffffffff
#define bug puts("hear!")
#define inf 0x7fffffff
#define eps 1e-8
#define FRE freopen("in.txt","r",stdin)
#define E exp(1.0)
template<typename T>  T Gmax(T a,T b){return a>b?a:b;}
template<typename T>  T Gmin(T a,T b){return a<b?a:b;}
const int N=100005;

LL abs(LL a)
{
    return a>0?a:-a;
}

LL exgcd(LL a,LL b,LL &x,LL &y)
{
    if(b==0)
    {
        x=1;
        y=0;
        return a;
    }
    LL g=exgcd(b,a%b,x,y);
    LL temp=x;
    x=y;
    y=temp-(a/b)*y;
    return g;
}

int main()
{

    LL a,b,c,a1,b1,c1,x,y,d;
    while(cin>>a>>b>>c)
    {
        a1=abs(a),b1=abs(b),c1=abs(c);
        d=exgcd(a1,b1,x,y);
        if(c1%d!=0)
        {
            printf("-1\n");
            continue;
        }
        LL qa=LL(a<0)-LL(a>0);
        LL qb=LL(b<0)-LL(b>0);
        cout<<qa*x*c<<" "<<qb*y*c<<endl;
    }
    return 0;
}


//#pragma warning(disable:4786)
#include<iostream>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<ctime>
#include<string.h>
using namespace std;

#define pi acos(-1.0)
//#define LL __int64
typedef long long LL;
#define INF 0x7fffffffffffffff
#define bug puts("hear!")
#define inf 0x7fffffff
#define eps 1e-8
#define FRE freopen("in.txt","r",stdin)
#define E exp(1.0)
template<typename T>  T Gmax(T a,T b){return a>b?a:b;}
template<typename T>  T Gmin(T a,T b){return a<b?a:b;}
const int N=100005;

LL exgcd(LL a,LL b,LL &x,LL &y)
{
    if(b==0)
    {
        x=1;
        y=0;
        return a;
    }
    LL g=exgcd(b,a%b,x,y);
    LL temp=x;
    x=y;
    y=temp-(a/b)*y;
    return g;
}

int main()
{

    LL a,b,c,a1,b1,c1,x,y,d;
    while(cin>>a>>b>>c)
    {
        a1=abs(a),b1=abs(b),c1=abs(c);
        d=exgcd(a1,b1,x,y);
        if(c1%d!=0)
        {
            printf("-1\n");
            continue;
        }
        LL qa=LL(a<0)-LL(a>0);
        LL qb=LL(b<0)-LL(b>0);
        cout<<qa*x*c<<" "<<qb*y*c<<endl;
    }
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <climits>
//#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for(int i = 0; i < int(n); ++i)
#define REPV(i, n) for (int i = (n) - 1; (int)i >= 0; --i)
#define FOR(i, a, b) for(int i = (int)(a); i <= (int)(b); ++i)
#define FORV(i, a, b) for(int i = (int)(a); i >= (int)(b); --i)

#define FE(i,t) for (typeof((t).begin())i=(t).begin();i!=(t).end();++i)
#define FEV(i,t) for (typeof((t).rbegin())i=(t).rbegin();i!=(t).rend();++i)

#define two(x) (1LL << (x))
#define ALL(a) (a).begin(), (a).end()

#define pb push_back
#define ST first
#define ND second
#define MP(x,y) make_pair(x, y)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<string> vs;

template<class T> void checkmin(T &a, T b){if (b<a)a=b;}
template<class T> void checkmax(T &a, T b){if (b>a)a=b;}
template<class T> void out(T t[], int n){REP(i, n)cout<<t[i]<<" "; cout<<endl;}
template<class T> void out(vector<T> t, int n=-1){for (int i=0; i<(n==-1?t.size():n); ++i) cout<<t[i]<<" "; cout<<endl;}
inline int count_bit(int n){return (n==0)?0:1+count_bit(n&(n-1));}
inline int low_bit(int n){return (n^n-1)&n;}
inline int ctz(int n){return (n==0?-1:ctz(n>>1)+1);}
int toInt(string s){int a; istringstream(s)>>a; return a;}
string toStr(int a){ostringstream os; os<<a; return os.str();}

const ll inf=5*1000000000000000000LL;

ll gcd(ll a, ll b){return !b?a:gcd(b, a%b);}
ll bezout(ll a, ll ua, ll va, ll b, ll ub, ll vb, ll &u, ll &v){
    if (!b){ u=ua; v=va; return a; }
    return bezout(b, ub, vb, a%b, ua-(a/b)*ub, va-(a/b)*vb, u, v);
}

int solve(ll a, ll b, ll c, ll &x, ll &y){
    if (abs(a)<abs(b)) return solve(b, a, c, y, x);
    if (b==0){
        if (a==c){x=1; y=0; return 0;}
        return 1;
    }
    ll d=gcd(abs(a), abs(b));
    c=-c;
    if (abs(c)<d || abs(c)%d) return 1;
    ll u, v;
    d=bezout(a, 1, 0, b, 0, 1, u ,v);
    ll ka=b/d, kb=-a/d;
    u*=c/d; v*=c/d;
    ka*=c/d; kb*=c/d;

    ll xa, xb, ya, yb;
    if (ka<0){
        xa=(u-inf)/-ka;
        xb=(u+inf)/-ka;
    }else{
        xb=(u+inf)/ka;
        xa=(u-inf)/ka;
    }
    if (kb<0){
        ya=(v-inf)/-kb;
        yb=(v+inf)/-kb;
    }else{
        yb=(v+inf)/kb;
        ya=(v-inf)/kb;
    }

    checkmax(xa, ya);
    checkmin(xb, yb);
    if (xa>xb) return 1;
    xa=(xa+xb)/2;

    x=u+ka*xa;
    y=v+kb*xa;
    return 0;
}

int main(){
    ll a, b, c;
    cin>>a>>b>>c;
    ll x, y;
    if (solve(a, b, c, x, y)) printf("-1\n");
    else cout<<x<<" "<<y<<endl;

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <climits>
//#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for(int i = 0; i < int(n); ++i)
#define REPV(i, n) for (int i = (n) - 1; (int)i >= 0; --i)
#define FOR(i, a, b) for(int i = (int)(a); i <= (int)(b); ++i)
#define FORV(i, a, b) for(int i = (int)(a); i >= (int)(b); --i)

#define FE(i,t) for (typeof((t).begin())i=(t).begin();i!=(t).end();++i)
#define FEV(i,t) for (typeof((t).rbegin())i=(t).rbegin();i!=(t).rend();++i)

#define two(x) (1LL << (x))
#define ALL(a) (a).begin(), (a).end()

#define pb push_back
#define ST first
#define ND second
#define MP(x,y) make_pair(x, y)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<string> vs;

template<class T> void checkmin(T &a, T b){if (b<a)a=b;}
template<class T> void checkmax(T &a, T b){if (b>a)a=b;}
template<class T> void out(T t[], int n){REP(i, n)cout<<t[i]<<" "; cout<<endl;}
template<class T> void out(vector<T> t, int n=-1){for (int i=0; i<(n==-1?t.size():n); ++i) cout<<t[i]<<" "; cout<<endl;}
inline int count_bit(int n){return (n==0)?0:1+count_bit(n&(n-1));}
inline int low_bit(int n){return (n^n-1)&n;}
inline int ctz(int n){return (n==0?-1:ctz(n>>1)+1);}
int toInt(string s){int a; istringstream(s)>>a; return a;}
string toStr(int a){ostringstream os; os<<a; return os.str();}

const ll inf=5*1000000000000000000LL;

ll gcd(ll a, ll b){return !b?a:gcd(b, a%b);}
ll bezout(ll a, ll ua, ll va, ll b, ll ub, ll vb, ll &u, ll &v){
    if (!b){ u=ua; v=va; return a; }
    return bezout(b, ub, vb, a%b, ua-(a/b)*ub, va-(a/b)*vb, u, v);
}

int solve(ll a, ll b, ll c, ll &x, ll &y){
    if (abs(a)<abs(b)) return solve(b, a, c, y, x);
    ll d=gcd(abs(a), abs(b));
    c=-c;
    if (abs(c)<d || abs(c)%d) return 1;
    ll u, v;
    d=bezout(a, 1, 0, b, 0, 1, u ,v);
    ll ka=b/d, kb=-a/d;
    u*=c/d; v*=c/d;
    ka*=c/d; kb*=c/d;

    ll xa, xb, ya, yb;
    if (ka<0){
        xa=(u-inf)/-ka;
        xb=(u+inf)/-ka;
    }else{
        xb=(u+inf)/ka;
        xa=(u-inf)/ka;
    }
    if (kb<0){
        ya=(v-inf)/-kb;
        yb=(v+inf)/-kb;
    }else{
        yb=(v+inf)/kb;
        ya=(v-inf)/kb;
    }

    checkmax(xa, ya);
    checkmin(xb, yb);
    if (xa>xb) return 1;
    xa=(xa+xb)/2;

    x=u+ka*xa;
    y=v+kb*xa;
    return 0;
}

int main(){
    ll a, b, c;
    cin>>a>>b>>c;
    ll x, y;
    if (solve(a, b, c, x, y)) printf("-1\n");
    else cout<<x<<" "<<y<<endl;

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <climits>
//#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for(int i = 0; i < int(n); ++i)
#define REPV(i, n) for (int i = (n) - 1; (int)i >= 0; --i)
#define FOR(i, a, b) for(int i = (int)(a); i <= (int)(b); ++i)
#define FORV(i, a, b) for(int i = (int)(a); i >= (int)(b); --i)

#define FE(i,t) for (typeof((t).begin())i=(t).begin();i!=(t).end();++i)
#define FEV(i,t) for (typeof((t).rbegin())i=(t).rbegin();i!=(t).rend();++i)

#define two(x) (1LL << (x))
#define ALL(a) (a).begin(), (a).end()

#define pb push_back
#define ST first
#define ND second
#define MP(x,y) make_pair(x, y)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<string> vs;

template<class T> void checkmin(T &a, T b){if (b<a)a=b;}
template<class T> void checkmax(T &a, T b){if (b>a)a=b;}
template<class T> void out(T t[], int n){REP(i, n)cout<<t[i]<<" "; cout<<endl;}
template<class T> void out(vector<T> t, int n=-1){for (int i=0; i<(n==-1?t.size():n); ++i) cout<<t[i]<<" "; cout<<endl;}
inline int count_bit(int n){return (n==0)?0:1+count_bit(n&(n-1));}
inline int low_bit(int n){return (n^n-1)&n;}
inline int ctz(int n){return (n==0?-1:ctz(n>>1)+1);}
int toInt(string s){int a; istringstream(s)>>a; return a;}
string toStr(int a){ostringstream os; os<<a; return os.str();}

const ll inf=5*1000000000000000000LL;

ll gcd(ll a, ll b){return !b?a:gcd(b, a%b);}
ll bezout(ll a, ll ua, ll va, ll b, ll ub, ll vb, ll &u, ll &v){
    if (!b){ u=ua; v=va; return a; }
    return bezout(b, ub, vb, a%b, ua-(a/b)*ub, va-(a/b)*vb, u, v);
}

int solve(ll a, ll b, ll c, ll &x, ll &y){
    if (abs(a)<abs(b)) return solve(b, a, c, y, x);
    if (b==0){
        if (c%a) return -1;
        x=-c/a; y=0;
        return 0;
    }
    ll d=gcd(abs(a), abs(b));
    c=-c;
    if (c%d) return 1;
    ll u, v;
    d=bezout(a, 1, 0, b, 0, 1, u ,v);
    ll ka=b/d, kb=-a/d;
    u*=c/d; v*=c/d;
    ka*=c/d; kb*=c/d;

    ll xa, xb, ya, yb;
    if (ka<0){
        xa=(u-inf)/-ka;
        xb=(u+inf)/-ka;
    }else{
        xb=(u+inf)/ka;
        xa=(u-inf)/ka;
    }
    if (kb<0){
        ya=(v-inf)/-kb;
        yb=(v+inf)/-kb;
    }else{
        yb=(v+inf)/kb;
        ya=(v-inf)/kb;
    }

    checkmax(xa, ya);
    checkmin(xb, yb);
    if (xa>xb) return 1;
    xa=(xa+xb)/2;

    x=u+ka*xa;
    y=v+kb*xa;
    return 0;
}

int main(){
    ll a, b, c;
    cin>>a>>b>>c;
    ll x, y;
    if (solve(a, b, c, x, y)) printf("-1\n");
    else cout<<x<<" "<<y<<endl;

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <climits>
//#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for(int i = 0; i < int(n); ++i)
#define REPV(i, n) for (int i = (n) - 1; (int)i >= 0; --i)
#define FOR(i, a, b) for(int i = (int)(a); i <= (int)(b); ++i)
#define FORV(i, a, b) for(int i = (int)(a); i >= (int)(b); --i)

#define FE(i,t) for (typeof((t).begin())i=(t).begin();i!=(t).end();++i)
#define FEV(i,t) for (typeof((t).rbegin())i=(t).rbegin();i!=(t).rend();++i)

#define two(x) (1LL << (x))
#define ALL(a) (a).begin(), (a).end()

#define pb push_back
#define ST first
#define ND second
#define MP(x,y) make_pair(x, y)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<string> vs;

template<class T> void checkmin(T &a, T b){if (b<a)a=b;}
template<class T> void checkmax(T &a, T b){if (b>a)a=b;}
template<class T> void out(T t[], int n){REP(i, n)cout<<t[i]<<" "; cout<<endl;}
template<class T> void out(vector<T> t, int n=-1){for (int i=0; i<(n==-1?t.size():n); ++i) cout<<t[i]<<" "; cout<<endl;}
inline int count_bit(int n){return (n==0)?0:1+count_bit(n&(n-1));}
inline int low_bit(int n){return (n^n-1)&n;}
inline int ctz(int n){return (n==0?-1:ctz(n>>1)+1);}
int toInt(string s){int a; istringstream(s)>>a; return a;}
string toStr(int a){ostringstream os; os<<a; return os.str();}

const ll inf=5*1000000000000000000LL;

ll gcd(ll a, ll b){return !b?a:gcd(b, a%b);}
ll bezout(ll a, ll ua, ll va, ll b, ll ub, ll vb, ll &u, ll &v){
    if (!b){ u=ua; v=va; return a; }
    return bezout(b, ub, vb, a%b, ua-(a/b)*ub, va-(a/b)*vb, u, v);
}

int solve(ll a, ll b, ll c, ll &x, ll &y){
    if (abs(a)<abs(b)) return solve(b, a, c, y, x);
    if (b==0){
        if (abs(c)<abs(a) || c%a) return -1;
        x=c/a; y=0;
        return 0;
    }
    ll d=gcd(abs(a), abs(b));
    c=-c;
    if (abs(c)<d || abs(c)%d) return 1;
    ll u, v;
    d=bezout(a, 1, 0, b, 0, 1, u ,v);
    ll ka=b/d, kb=-a/d;
    u*=c/d; v*=c/d;
    ka*=c/d; kb*=c/d;

    ll xa, xb, ya, yb;
    if (ka<0){
        xa=(u-inf)/-ka;
        xb=(u+inf)/-ka;
    }else{
        xb=(u+inf)/ka;
        xa=(u-inf)/ka;
    }
    if (kb<0){
        ya=(v-inf)/-kb;
        yb=(v+inf)/-kb;
    }else{
        yb=(v+inf)/kb;
        ya=(v-inf)/kb;
    }

    checkmax(xa, ya);
    checkmin(xb, yb);
    if (xa>xb) return 1;
    xa=(xa+xb)/2;

    x=u+ka*xa;
    y=v+kb*xa;
    return 0;
}

int main(){
    ll a, b, c;
    cin>>a>>b>>c;
    ll x, y;
    if (solve(a, b, c, x, y)) printf("-1\n");
    else cout<<x<<" "<<y<<endl;

    return 0;
}