#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, vx, vy;
long long X, Y, XX, YY;
long long extgcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1, y = 0;
    return a;
  }
  int d = extgcd(b, a % b, y, x);
  y -= a / b * x;
  return d;
}
int main() {
  scanf("%d%d%d%d%d%d", &n, &m, &x, &y, &vx, &vy);
  if (!vx) {
    if (x == 0) {
      if (vy == -1)
        printf("0 0\n");
      else
        printf("0 %d\n", m);
    } else if (x == n) {
      if (vy == -1)
        printf("%d 0\n", n);
      else
        printf("%d %d\n", n, m);
    } else
      printf("-1\n");
    return 0;
  }
  if (!vy) {
    if (y == 0) {
      if (vx == -1)
        printf("0 0\n");
      else
        printf("%d 0\n", n);
    } else if (y == m) {
      if (vx == -1)
        printf("0 %d\n", m);
      else
        printf("%d %d\n", n, m);
    } else
      printf("-1\n");
    return 0;
  }
  if (vx == -1) x = n - x;
  if (vy == -1) y = m - y;
  int g = extgcd(n, m, X, Y);
  if ((x - y) % g) {
    printf("-1\n");
    return 0;
  }
  X = X * (x - y) / g % (m / g);
  if (X <= 0) X += m / g;
  XX = X * n, YY = XX + y - x;
  XX /= n, YY /= m;
  printf("%d %d\n", XX % 2 == (vx == -1) ? 0 : n, YY % 2 == (vy == -1) ? 0 : m);
  return 0;
}
