#include <bits/stdc++.h>
using namespace std;
int N, M, x, y, a, b;
int dis(int xx, int yy) {
  if (xx % a != x % a || yy % b != y % b) return 0x3f3f3f3f;
  int res = abs(xx - x) / a + abs(yy - y) / b;
  return res % 2 ? 0x3f3f3f3f : max(abs(xx - x) / a, abs(yy - y) / b);
}
int main() {
  scanf("%d%d%d%d%d%d", &N, &M, &x, &y, &a, &b);
  int ans = 0x3f3f3f3f;
  if (x == N && y == M || x == 1 && y == M || x == N && y == 1 ||
      x == 1 && y == 1) {
    printf("0\n");
    return 0;
  }
  if (x + a > N && x - a < 1 || y + b > M && y - b < 1) {
    printf("Poor Inna and pony!\n");
    return 0;
  }
  ans = min(min(dis(1, 1), dis(1, M)), min(dis(N, 1), dis(N, M)));
  if (ans == 0x3f3f3f3f)
    cout << "Poor Inna and pony!\n";
  else
    cout << ans << endl;
  return 0;
}
