#include <bits/stdc++.h>
using std::abs;
using std::cin;
using std::cout;
using std::max;
using std::min;
int n, m, i, j, a, b;
bool nomod(int x, int y) {
  if (x % a == 0 && y % b == 0) return false;
  return true;
}
int ans = 1 << 30;
int main() {
  cin >> n >> m >> i >> j >> a >> b;
  if ((i == 1 || i == n) && (j == 1 || j == m)) {
    cout << 0;
    return 0;
  }
  if (nomod(i - 1, j - 1) && nomod(i - 1, m - j) && nomod(n - i, j) &&
      nomod(n - i, m - j)) {
    printf("Poor Inna and pony!");
    return 0;
  }
  if ((i + a > n && i - a < 1) || (j + b > m && j - b < 1)) {
    printf("Poor Inna and pony!");
    return 0;
  }
  int x, y;
  x = (i - 1) / a;
  y = (j - 1) / b;
  if (!nomod(i - 1, j - 1) && abs(x - y) % 2 == 0) ans = min(ans, max(x, y));
  x = (i - 1) / a;
  y = (m - j) / b;
  if (!nomod(i - 1, m - j) && abs(x - y) % 2 == 0) ans = min(ans, max(x, y));
  x = (n - i) / a;
  y = (j - 1) / b;
  if (!nomod(n - i, j - 1) && abs(x - y) % 2 == 0) ans = min(ans, max(x, y));
  x = (n - i) / a;
  y = (m - j) / b;
  if (!nomod(n - i, m - j) && abs(x - y) % 2 == 0) ans = min(ans, max(x, y));
  if (ans == (1 << 30)) {
    printf("Poor Inna and pony!");
    return 0;
  }
  cout << ans;
}
