#include <bits/stdc++.h>
using namespace std;
long long n, m, px, py, vx, vy;
long long extgcd(long long a, long long b, long long& x, long long& y) {
  long long d = a;
  if (b != 0) {
    d = extgcd(b, a % b, y, x);
    y -= (a / b) * x;
  } else {
    x = 1, y = 0;
  }
  return d;
}
void solve() {
  if (vx != 0 && vy != 0) {
    long long k, gcd, x, y, gx, gy;
    gx = vx < 0 ? n - px : px;
    gy = vy < 0 ? m - py : py;
    gcd = extgcd(n, m, x, y);
    k = gx - gy;
    if (k % gcd != 0) {
      printf("-1\n");
    } else {
      x = x * abs(k) / gcd % (m / gcd);
      y = y * abs(k) / gcd % (n / gcd);
      if (k > 0) {
        if (x < 0) x += m / gcd;
        if (y > 0) y = n / gcd - y;
      } else {
        if (x > 0) x = m / gcd - x;
        if (y < 0) y += n / gcd;
      }
      if (x == 0) x += m / gcd;
      if (y == 0) y += n / gcd;
      printf("%I64d %I64d\n", (x + (vx < 0)) % 2 == 0 ? 0 : n,
             (y + (vy < 0)) % 2 == 0 ? 0 : m);
    }
  } else {
    if (vx != 0) {
      if (py != 0 && py != m)
        printf("-1\n");
      else
        printf("%I64d %I64d\n", vx > 0 ? m : 0, py);
    } else {
      if (px != 0 && px != n)
        printf("-1\n");
      else
        printf("%I64d %I64d\n", px, vy > 0 ? n : 0);
    }
  }
}
int main() {
  cin >> n >> m >> px >> py >> vx >> vy;
  solve();
  return 0;
}
