#include <bits/stdc++.h>
using namespace std;
long long n, m, x, y, vx, vy, a, b, c;
long long temp, dx, dy;
long long exgcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long temp, x2, y2;
  temp = exgcd(b, a % b, x, y);
  x2 = x, y2 = y;
  x = y2;
  y = x2 - a / b * y2;
  return temp;
}
int main() {
  scanf("%lld%lld%lld%lld%lld%lld", &n, &m, &x, &y, &vx, &vy);
  a = -vx * vy * n;
  b = m;
  c = y - vx * vy * x;
  if (a) {
    temp = exgcd(a, b, x, y);
    if (c % temp == 0) {
      x = x * c / temp;
      y = y * c / temp;
      if (vx == 1) {
        x = (x % abs(b / temp) + abs(b / temp)) % abs(b / temp);
        if (x == 0) x = abs(b / temp);
      } else if (vx == -1) {
        x = (x % abs(b / temp) + abs(b / temp)) % abs(b / temp);
        if (x != 0) x -= abs(b / temp);
      }
      y = (c - a * x) / b;
      dx = dy = 0;
      if (x % 2) dx = n;
      if (y % 2) dy = m;
      printf("%lld %lld\n", dx, dy);
    } else
      printf("-1\n");
  } else {
    if (vy == -1 && x == 0 || vx == -1 && y == 0)
      printf("%d %d\n", 0, 0);
    else if (vx == 1 && y == 0 || vy == -1 && x == n)
      printf("%lld %d\n", n, 0);
    else if (vy == 1 && x == 0 || vx == -1 && y == m)
      printf("%d %lld\n", 0, m);
    else if (vx == 1 && y == m || vy == 1 && x == n)
      printf("%lld %lld\n", n, m);
    else
      printf("-1\n");
  }
  return 0;
}
