#include <bits/stdc++.h>
using namespace std;
long long X0, X1, Y0, Y1;
pair<long long, long long> g;
void out() {
  cout << -1 << endl;
  exit(0);
}
void out(long long a, long long b) {
  cout << a << " " << b << endl;
  exit(0);
}
long long bmm(long long x, long long y) { return y ? bmm(y, x % y) : x; }
long long kmm(long long x, long long y) {
  x = abs(x);
  y = abs(y);
  return x / bmm(x, y) * y;
}
pair<long long, long long> solve(long long x, long long y) {
  if (!y) return {1, 0};
  pair<long long, long long> ans = solve(y, x % y);
  if (abs(ans.first) > kmm(x, y) or abs(ans.second > kmm(x, y))) {
    cout << "fuck hard" << endl;
    assert(0);
  }
  return {ans.second, ans.first - ans.second * (x / y)};
}
void solve(long long x, long long y, long long d) {
  if (d % bmm(x, y)) out();
  long long D = bmm(x, y);
  long long c = d / D;
  pair<long long, long long> ans = solve(x, y);
  long long A = ans.first * c, B = ans.second * c;
  if (A <= 0) {
    long long z = -A / g.first;
    A += g.first * z, B += g.second * z;
  }
  if (A > g.first) {
    long long z = A / g.first;
    A -= g.first * z, B -= g.second * z;
  }
  while (A <= 0) A += g.first, B += g.second;
  while (A > g.first) A -= g.first, B -= g.second;
  if (abs(A) % 2 == 0) swap(X0, X1);
  if (abs(B) % 2 == 0) swap(Y0, Y1);
  cout << X1 << " " << Y1 << endl;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, m, x, y, vx, vy;
  cin >> n >> m >> x >> y >> vx >> vy;
  if (!vx and !vy) out();
  if (!vx) {
    if (x == 0 or x == n) out(x, vy > 0 ? m : 0);
    out();
  }
  if (!vy) {
    if (y == 0 or y == m) out(vx > 0 ? n : 0, y);
    out();
  }
  X1 = n, Y1 = m;
  if (vx < 0) x = n - x, swap(X0, X1);
  if (vy < 0) y = m - y, swap(Y0, Y1);
  g = {kmm(n, m) / n, -kmm(n, m) / m};
  solve(n, m, x - y);
  return 0;
}
