#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long ans[100010];
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 r = exgcd(b, a % b, x, y);
  long long t = x;
  x = y;
  y = t - a / b * y;
  return r;
}
int main() {
  int n, m, x, y, vx, vy;
  cin >> n >> m >> x >> y >> vx >> vy;
  if (vx == 0 || vy == 0) {
    if (x > 0 && y > 0 && x < n && y < m) {
      cout << -1 << endl;
      return 0;
    }
    if (vy == 1 && x == 0 || vx == -1 && y == m) {
      cout << "0 " << m << endl;
      return 0;
    } else if (vy == -1 && x == 0 || vx == -1 && y == 0) {
      cout << "0 0\n";
      return 0;
    } else if (vx == 1 && y == 0 || vy == -1 && x == n) {
      cout << n << " 0\n";
      return 0;
    } else if (vx == 1 && y == m || vy == 1 && x == n) {
      cout << n << " " << m << "\n";
      return 0;
    } else {
      cout << -1 << endl;
      return 0;
    }
  }
  int dirx = 0;
  int diry = 0;
  if (vx == -1) dirx = 1, x = n - x;
  if (vy == -1) diry = 1, y = m - y;
  long long a = n;
  long long b = m;
  long long c = x - y;
  long long resx, resy;
  long long d = exgcd(a, b, resx, resy);
  if (c % d != 0) {
    cout << -1 << endl;
    return 0;
  }
  a = a / d;
  b = b / d;
  c = c / d;
  b = abs(b);
  resx = resx * c;
  if (resx % b <= 0)
    resx = resx % b + b;
  else
    resx = resx % b;
  resy = -(x - y - resx * n) / m;
  long long p = 0;
  long long q = 0;
  if (resx % 2) p = n;
  if (resy % 2) q = m;
  if (dirx) p = n - p;
  if (diry) q = m - q;
  cout << p << " " << q << endl;
  return 0;
}
