#include <bits/stdc++.h>
using namespace std;
long long n, m, x, y, vx, vy;
bool flagx = false, flagy = false;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
void exgcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) return x = 1, y = 0, void();
  exgcd(b, a % b, x, y);
  long long t = x;
  x = y, y = t - a / b * y;
}
signed main() {
  cin >> n >> m >> x >> y >> vx >> vy;
  if (vy == 0) {
    if (y == 0 || y == m)
      printf("%lld %lld\n", vx > 0 ? n : 0, y);
    else
      printf("-1\n");
    return 0;
  }
  if (vx == 0) {
    if (x == 0 || x == n)
      printf("%lld %lld\n", x, vy > 0 ? m : 0);
    else
      printf("-1\n");
    return 0;
  }
  if (vx < 0) vx = -vx, x = n - x, flagx = true;
  if (vy < 0) vy = -vy, y = m - y, flagy = true;
  long long A, B, C = gcd(n, m);
  if ((x - y) % C) return printf("-1"), 0;
  long long dA = -m / C, dB = n / C;
  exgcd(n, m, A, B), B = -B;
  if (dA < 0) dA = -dA, dB = -dB;
  A *= (x - y) / C, A = (A % dA + dA) % dA;
  if (!A) A = dA;
  B = (A * n - (x - y)) / m;
  printf("%lld %lld\n", ((A & 1) ^ flagx) ? n : 0, ((B & 1) ^ flagy) ? m : 0);
}
