#include <bits/stdc++.h>
using namespace std;
long double const PI = acosl(-1);
const int INF = 1E9 + 4;
const int MAXN = 2e5 + 123;
const long double EPS = 3e-16;
const long long MOD = 1e9 + 7;
int binpow(int a, int n) {
  int res = 1;
  while (n) {
    if (n & 1) res *= a;
    a *= a;
    n >>= 1;
  }
  return res;
}
bool isv(char a) {
  return (a == 'a' || a == 'A' || a == 'E' || a == 'I' || a == 'O' ||
          a == 'U' || a == 'Y' || a == 'e' || a == 'i' || a == 'o' ||
          a == 'u' || a == 'y');
}
long long a[MAXN];
int b[MAXN];
string c[] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "B", "H"};
bool fl, f;
int di(int x1, int y1, int x2, int y2) {
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
void solve() {
  int n, m, i, j, a, b;
  cin >> n >> m >> i >> j >> a >> b;
  int dx[] = {1, n, n, 1};
  int dy[] = {m, 1, m, 1};
  int mx = 1e9 + 1;
  for (int t = 0; t < 4; t++) {
    if (abs(dx[t] - i) % a == 0 && abs(dy[t] - j) % b == 0) {
      int l = abs(dx[t] - i) / a;
      int m = abs(dy[t] - j) / b;
      if ((l - m) % 2 == 0) mx = min(max(l, m), mx);
    }
  }
  if (mx == 1e9 + 1 || (mx != 0 && (n <= a || m <= b)))
    cout << "Poor Inna and pony!";
  else
    cout << mx;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
