#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, vx, vy;
long long exgcd(long long a, long long b, long long &x, long long &y) {
  if (!b) {
    x = 1;
    y = 0;
    return a;
  }
  int ans = exgcd(b, a % b, y, x);
  y -= (a / b) * x;
  return ans;
}
int main() {
  scanf("%d%d%d%d%d%d", &n, &m, &x, &y, &vx, &vy);
  if (x % n == 0 && y % m == 0) {
    printf("%d %d\n", x, y);
    return 0;
  }
  if (vx == 0) {
    if (x % n == 0) {
      if (vy == 1)
        printf("%d %d\n", x, m);
      else
        printf("%d %d\n", x, 0);
    } else
      puts("-1");
    return 0;
  }
  if (vy == 0) {
    if (y % m == 0) {
      if (vx == 1)
        printf("%d %d\n", n, y);
      else
        printf("%d %d\n", 0, y);
    } else
      puts("-1");
    return 0;
  }
  int fx = 0, fy = 0;
  if (vx == -1) {
    x = n - x;
    fx = 1;
  }
  if (vy == -1) {
    y = m - y;
    fy = 1;
  }
  long long a, b;
  long long gcd = exgcd(n, m, a, b);
  if ((x - y) % gcd != 0) {
    puts("-1");
    return 0;
  }
  long long t = (x - y) / gcd;
  a *= t;
  b *= t;
  long long m1 = m / gcd, n1 = n / gcd;
  long long a1 = (a % m1 + m1 + m1 - 1) % m1 + 1;
  long long b1 = -((x - y) - a1 * n) / m;
  long long ansx, ansy;
  if (a1 & 1)
    ansx = n;
  else
    ansx = 0;
  if (b1 & 1)
    ansy = m;
  else
    ansy = 0;
  if (fx) ansx = n - ansx;
  if (fy) ansy = m - ansy;
  printf("%lld %lld\n", ansx, ansy);
  return 0;
}
