#include <bits/stdc++.h>
int n, m, a, b, i, j;
int Min(int x, int y) { return x < y ? x : y; }
int Max(int x, int y) { return x > y ? x : y; }
int Abs(int x) { return x < 0 ? -x : x; }
int cal(int x, int y) {
  if (x == i && y == j) return 0;
  int xx = Abs(x - i);
  int yy = Abs(y - j);
  if (xx % a != 0 || yy % b != 0) return 999999999;
  int xi = xx / a, yi = yy / b;
  if (xi % 2 != yi % 2) return 999999999;
  if ((x == i && i + a > n && i - a < 1) || (y == j && j + b > m && j - b < 1))
    return 999999999;
  return Max(xi, yi);
}
int main() {
  scanf("%d%d%d%d%d%d", &n, &m, &i, &j, &a, &b);
  int ans = Min(cal(1, 1), cal(n, m));
  ans = Min(ans, cal(1, m));
  ans = Min(ans, cal(n, 1));
  if (ans == 999999999)
    printf("Poor Inna and pony!\n");
  else
    printf("%d\n", ans);
  return 0;
}
