#include <bits/stdc++.h>
using namespace std;
bool invx, invy;
long long dimx, dimy, x, y, dx, dy;
void print(long long a, long long b = -1) {
  if (b == -1) {
    cout << "-1\n";
  } else {
    if (invx) a = dimx - a;
    if (invy) b = dimy - b;
    cout << a << " " << b << "\n";
  }
  exit(0);
}
long long d;
pair<long long, long long> gcd(long long a, long long b) {
  if (b == 0) {
    d = a;
    return {1, 0};
  } else {
    auto it = gcd(b, a % b);
    return {it.second, it.first - a / b * it.second};
  }
}
signed main() {
  cin >> dimx >> dimy >> x >> y >> dx >> dy;
  if (dx == 0) {
    if (dy == +1) {
      if (x == 0 || x == dimx) print(x, dimy);
      print(-1);
    } else {
      if (x == 0 || x == dimx) print(x, 0);
      print(-1);
    }
  }
  if (dy == 0) {
    if (dx == +1) {
      if (y == 0 || y == dimy) print(dimx, y);
      print(-1);
    } else {
      if (y == 0 || y == dimy) print(0, y);
      print(-1);
    }
  }
  if (dx == -1) dx *= -1, invx ^= 1, x = dimx - x;
  if (dy == -1) dy *= -1, invy ^= 1, y = dimy - y;
  long long dif = x - y;
  auto it = gcd(dimx, dimy);
  if (abs(dif) % d != 0) {
    print(-1);
  }
  long long k1 = it.first, k2 = -it.second, jump = abs(dimy / d);
  k1 *= dif / d;
  while (k1 <= (x - 1) / dimx) k1 += jump;
  while ((k1 - jump) >= (x + dimx - 1) / dimx) k1 -= jump;
  long long t = k1 * dimx - x;
  x = (x + t) / dimx;
  y = (y + t) / dimy;
  x = (x & 1) ? dimx : 0;
  y = (y & 1) ? dimy : 0;
  print(x, y);
  return 0;
}
