#include <bits/stdc++.h>
using namespace std;
bool invx, invy;
long long dimx, dimy, x, y, dx, dy;
void print(long long a, long long b = -1) {
  if (b == -1) {
    assert(a == -1);
    cout << "-1\n";
  } else {
    if (invx) a = dimx - a;
    if (invy) b = dimy - b;
    cout << a << " " << b << "\n";
  }
  exit(0);
}
long long d;
pair<long long, long long> gcd(long long a, long long b) {
  if (b == 0) {
    d = a;
    return {1, 0};
  } else {
    auto it = gcd(b, a % b);
    return {it.second, it.first - a / b * it.second};
  }
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> dimx >> dimy >> x >> y >> dx >> dy;
  if (dx == 0) {
    assert(dy != 0);
    if (dy == +1) {
      if (x == 0 || x == dimx) print(x, dimy);
      print(-1);
    } else {
      assert(dy == -1);
      if (x == 0 || x == dimx) print(x, 0);
      print(-1);
    }
  }
  if (dy == 0) {
    assert(dx != 0);
    if (dx == +1) {
      if (y == 0 || y == dimy) print(dimx, y);
      print(-1);
    } else {
      assert(dx == -1);
      if (y == 0 || y == dimy) print(0, y);
      print(-1);
    }
  }
  assert(dx != 0);
  assert(dy != 0);
  if (dx == -1) dx *= -1, invx ^= 1, x = dimx - x;
  if (dy == -1) dy *= -1, invy ^= 1, y = dimy - y;
  assert(dx == 1);
  assert(dy == 1);
  long long dif = x - y;
  auto it = gcd(dimx, dimy);
  if (abs(dif) % d != 0) {
    print(-1);
  }
  long long k1 = it.first, k2 = -it.second, s1 = dimx / d, s2 = dimy / d;
  k1 *= dif / d;
  k2 *= dif / d;
  if (s1 < 0) {
    s1 *= -1;
    s2 *= -1;
  }
  swap(s1, s2);
  while (k1 < 0) {
    k1 += s1;
    k2 += s2;
  }
  while (k1 <= (x - 1) / dimx) {
    k1 += s1;
    k2 += s2;
  }
  while ((k1 - s1) >= (x + dimx - 1) / dimx) {
    k1 -= s1;
    k2 -= s2;
  }
  assert(k1 * dimx - k2 * dimy == x - y);
  for (long long t = 0; t <= 100000; t++) {
    t = k1 * dimx - x;
    if ((x + t) % dimx == 0 && (y + t) % dimy == 0) {
      x = (x + t) / dimx;
      y = (y + t) / dimy;
      x %= 2;
      y %= 2;
      x ^= 1;
      y ^= 1;
      x = x ? 0 : dimx;
      y = y ? 0 : dimy;
      print(x, y);
    }
    break;
  }
  assert(0);
  return 0;
}
