#include <bits/stdc++.h>
using namespace std;
int f(int n, int m, int stx, int sty, int enx, int eny, int a, int b) {
  if (stx == enx && sty == eny) return 0;
  int dx = abs(enx - stx);
  int dy = abs(eny - sty);
  if (dx % a != 0 || dy % b != 0) return 10000000;
  int x = dx / a;
  int y = dy / b;
  if ((x & 1) != (y & 1)) return 10000000;
  if (x > 0 && y > 0) return max(x, y);
  if (x == 0 && max(stx - 1, n - stx) >= a) return y;
  if (y == 0 && max(sty - 1, m - sty) >= b) return x;
  return 10000000;
}
int main() {
  int n, m, st, en, a, b;
  while (~scanf("%d%d%d%d%d%d", &n, &m, &st, &en, &a, &b)) {
    int ret = 10000000;
    ret = min(ret, f(n, m, st, en, 1, m, a, b));
    ret = min(ret, f(n, m, st, en, n, 1, a, b));
    ret = min(ret, f(n, m, st, en, n, m, a, b));
    ret = min(ret, f(n, m, st, en, 1, 1, a, b));
    if (ret == 10000000)
      puts("Poor Inna and pony!");
    else
      printf("%d\n", ret);
  }
}
