#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, a, b, mn = 2000000000;
  cin >> n >> m >> i >> j >> a >> b;
  if ((i == 1 && j == 1) || (i == 1 && j == m) || (i == n && j == 1) ||
      (i == n && j == m)) {
    cout << "0";
    return 0;
  }
  if ((((i - a) < 1 && (i + a) > n) || ((j - b) < 1 && (j + b) > m))) {
    cout << "Poor Inna and pony!";
    return 0;
  }
  int du = i - 1;
  int dd = n - i;
  int dr = m - j;
  int dl = j - 1;
  if ((du) % a == 0 && (dl) % b == 0) {
    int x = du / a, y = dl / b;
    int p = min(x, y);
    int dx = x - p;
    int dy = y - p;
    if (dx == 0 && (dy % 2) == 0)
      mn = min(mn, max(x, y));
    else if (dy == 0 && (dx % 2) == 0)
      mn = min(mn, max(x, y));
  }
  if ((du) % a == 0 && (dr) % b == 0) {
    int x = du / a, y = dr / b;
    int p = min(x, y);
    int dx = x - p;
    int dy = y - p;
    if (dx == 0 && (dy % 2) == 0)
      mn = min(mn, max(x, y));
    else if (dy == 0 && (dx % 2) == 0)
      mn = min(mn, max(x, y));
  }
  if ((dd) % a == 0 && (dl) % b == 0) {
    int x = dd / a, y = dl / b;
    int p = min(x, y);
    int dx = x - p;
    int dy = y - p;
    if (dx == 0 && (dy % 2) == 0)
      mn = min(mn, max(x, y));
    else if (dy == 0 && (dx % 2) == 0)
      mn = min(mn, max(x, y));
  }
  if ((dd) % a == 0 && (dr) % b == 0) {
    int x = dd / a, y = dr / b;
    int p = min(x, y);
    int dx = x - p;
    int dy = y - p;
    if (dx == 0 && (dy % 2) == 0)
      mn = min(mn, max(x, y));
    else if (dy == 0 && (dx % 2) == 0)
      mn = min(mn, max(x, y));
  }
  if (mn == 2000000000)
    cout << "Poor Inna and pony!";
  else
    cout << mn;
  return 0;
}
