#include <bits/stdc++.h>
using namespace std;
long long n, m, x, y, v_x, v_y;
long long a, b;
int exgcd(long long x1, long long y1, long long &a, long long &b) {
  if (!y1) {
    a = 1, b = 0;
    return x1;
  }
  int tmp = exgcd(y1, x1 % y1, b, a);
  b -= (x1 / y1) * a;
  return tmp;
}
int main() {
  scanf("%I64d%I64d%I64d%I64d%I64d%I64d", &n, &m, &x, &y, &v_x, &v_y);
  if (v_x == 0) {
    (x == 0 || x == n) ? printf("%I64d %I64d\n", x, (v_y == 1) ? m : 0)
                       : printf("-1\n");
    return 0;
  }
  if (v_y == 0) {
    (y == 0 || y == m) ? printf("%I64d %I64d\n", (v_x == 1) ? n : 0, y)
                       : printf("-1\n");
    return 0;
  }
  long long place = exgcd(n, m, a, b), need;
  bool fla1 = 0, fla2 = 0;
  if (v_x == -1) fla1 = true, x = n - x;
  if (v_y == -1) fla2 = true, y = m - y;
  need = x - y;
  if (need % place) {
    printf("-1\n");
    return 0;
  }
  long long ans1 = (a * need / place % (m / place) + (m / place)) % (m / place);
  if (ans1 == 0) ans1 += m / place;
  long long ans2 = -(x - y - ans1 * n) / m;
  long long ans_x = 0, ans_y = 0;
  if (ans1 % 2) ans_x = n;
  if (ans2 % 2) ans_y = m;
  if (fla1) ans_x = n - ans_x;
  if (fla2) ans_y = m - ans_y;
  printf("%I64d %I64d\n", ans_x, ans_y);
}
