#include <bits/stdc++.h>
using namespace std;
const long long OO = 1e8;
long long GCD(long long a, long long b) { return (b == 0 ? a : GCD(b, a % b)); }
string CF[] = {"No", "Yes"};
int n, m, i, j, a, b;
bool corner() {
  if ((i == 1 && j == 1) || (i == 1 && j == m)) return true;
  if ((i == n && j == 1) || (i == n && j == m)) return true;
  return false;
}
int checkthis(int f, int s) {
  if (f % a == 0 && s % b == 0) {
    int d = f / a, v = s / b;
    if (abs(d - v) % 2 == 0) return max(f / a, s / b);
  }
  return -1;
}
int main() {
  ios_base ::sync_with_stdio(0);
  ;
  int res = -1;
  cin >> n >> m >> i >> j >> a >> b;
  if (corner()) {
    cout << 0 << endl;
    return 0;
  } else if (a >= n || b >= m) {
    cout << "Poor Inna and pony!" << endl;
    return 0;
  }
  vector<int> t(4);
  t[0] = checkthis(abs(1 - i), abs(1 - j));
  t[1] = checkthis(abs(1 - i), abs(m - j));
  t[2] = checkthis(abs(n - i), abs(1 - j));
  t[3] = checkthis(abs(n - i), abs(m - j));
  sort((t).rbegin(), (t).rend());
  for (int i = 0; i < (int)(4); ++i) {
    if (t[i] >= 0) {
      if (res == -1)
        res = t[i];
      else
        res = min(t[i], res);
    }
  }
  if (res == -1)
    cout << "Poor Inna and pony!" << endl;
  else
    cout << res;
  return 0;
}
