#include <bits/stdc++.h>
using namespace std;
long long exgcd(long long a, long long b, long long& x, long long& y) {
  if (b == 0) {
    x = 1, y = 0;
    return a;
  }
  long long d = exgcd(b, a % b, y, x);
  y -= a / b * x;
  return d;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, m, x, y, vx, vy;
  cin >> n >> m >> x >> y >> vx >> vy;
  if (vx == 0) {
    if (vy > 0) {
      if (x == 0)
        cout << "0 " << m;
      else if (x == n)
        cout << n << " " << m;
      else
        cout << "-1";
    } else if (vy < 0) {
      if (x == 0)
        cout << "0 0";
      else if (x == n)
        cout << n << " " << 0;
      else
        cout << "-1";
    } else
      cout << "-1";
  } else if (vy == 0) {
    if (vx < 0) {
      if (y == 0)
        cout << "0 0";
      else if (y == m)
        cout << "0 " << m;
      else
        cout << "-1";
    } else if (vx > 0) {
      if (y == 0)
        cout << n << " " << 0;
      else if (y == m)
        cout << n << " " << m;
      else
        cout << "-1";
    } else
      cout << "-1";
  } else {
    if (vx < 0) x = n - x;
    if (vy < 0) y = m - y;
    long long a, b, d = exgcd(n, m, a, b);
    a *= (x - y) / d, b *= (x - y) / d;
    if ((x - y) % d)
      cout << "-1";
    else {
      int n_ = n / d, m_ = m / d;
      a = (a % m_ + m_ + m_ - 1) % m_ + 1;
      b = -((x - y) - a * n) / m;
      long long resx = n, resy = m;
      if (a % 2 == 0) resx = n - resx;
      if (b % 2 == 0) resy = m - resy;
      if (vx < 0) resx = n - resx;
      if (vy < 0) resy = m - resy;
      cout << resx << " " << resy << endl;
    }
  }
  return 0;
}
