#include <bits/stdc++.h>
int min(int x1, int x2) {
  if (x1 < x2)
    return x1;
  else
    return x2;
}
int max(int x1, int x2) {
  if (x1 > x2)
    return x1;
  else
    return x2;
}
int n, m, i, j, a, b, dx, dy;
int count = 999999;
void check(int x1, int x2) {
  if (x1 == i && x2 == j) {
    count = 0;
    return;
  }
  if (i + a > n && i - a <= 0) return;
  if (j + b > m && j - b <= 0) return;
  x1 = abs(x1 - i);
  x2 = abs(x2 - j);
  if (x1 % a || x2 % b) return;
  x1 = x1 / a;
  x2 = x2 / b;
  if (x1 % 2 != x2 % 2) return;
  count = min(count, max(x1, x2));
}
int main() {
  scanf("%d %d %d %d %d %d", &n, &m, &i, &j, &a, &b);
  check(1, 1);
  check(1, m);
  check(n, 1);
  check(n, m);
  if (count == 999999)
    printf("Poor Inna and pony!");
  else
    printf("%d", count);
  return 0;
}
