#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, a, b, ans = 1e9, vis[5], cnta[5], cntb[5], res[5];
int main() {
  scanf("%d%d%d%d%d%d", &n, &m, &i, &j, &a, &b);
  if (i == 1 && j == 1 || i == n && j == 1 || i == n && j == m ||
      i == 1 && j == m) {
    puts("0");
    return 0;
  }
  if (n <= a || m <= b) {
    puts("Poor Inna and pony!");
    return 0;
  }
  if ((i - 1) % a == 0 && (j - 1) % b == 0)
    vis[1] = 1, cnta[1] = (i - 1) / a, cntb[1] = (j - 1) / b;
  if ((n - i) % a == 0 && (j - 1) % b == 0)
    vis[2] = 1, cnta[2] = (n - i) / a, cntb[2] = (j - 1) / b;
  if ((i - 1) % a == 0 && (m - j) % b == 0)
    vis[3] = 1, cnta[3] = (i - 1) / a, cntb[3] = (m - j) / b;
  if ((n - i) % a == 0 && (m - j) % b == 0)
    vis[4] = 1, cnta[4] = (n - i) / a, cntb[4] = (m - j) / b;
  for (int k = 1; k <= 4; k++) {
    if (vis[k] && (cnta[k] + cntb[k]) % 2 == 0)
      res[k] = max(cnta[k], cntb[k]);
    else
      res[k] = 1e9;
  }
  for (int k = 1; k <= 4; k++) ans = min(ans, res[k]);
  if (ans != 1e9)
    printf("%d", ans);
  else
    puts("Poor Inna and pony!");
  return 0;
}
