#include <bits/stdc++.h>
using namespace std;
bool in_corner(int i, int j, int n, int m) {
  if ((i == 1 && j == 1) || (i == 1 && j == m) || (i == n && j == m) ||
      (i == n && j == 1))
    return true;
  return false;
}
int main() {
  int n, m, i, j, a, b;
  cin >> n >> m >> i >> j >> a >> b;
  int r = n - i;
  int u = m - j;
  int ans = -1;
  if (in_corner(i, j, n, m)) {
    cout << 0 << endl;
    return 0;
  }
  i--;
  j--;
  if ((a > i && a > r) || (b > j && b > u)) {
    cout << "Poor Inna and pony!" << endl;
    return 0;
  }
  if (((i % a) == 0) && ((j % b) == 0)) {
    int id = i / a;
    int jl = j / b;
    if (id == jl) ans = id;
    if (!((max(id, jl) - min(id, jl)) & 1)) ans = max(id, jl);
  }
  if (i % a == 0 && u % b == 0) {
    int id = i / a;
    int ju = u / b;
    if (id == ju) {
      if (ans == -1)
        ans = id;
      else
        ans = min(id, ans);
    }
    if (!((max(id, ju) - min(id, ju)) & 1)) {
      if (ans == -1) ans = max(id, ju);
      ans = min(ans, max(id, ju));
    }
  }
  if (r % a == 0 && j % b == 0) {
    int id = r / a;
    int ju = j / b;
    if (id == ju) {
      if (ans == -1)
        ans = id;
      else
        ans = min(id, ans);
    }
    if (!((max(id, ju) - min(id, ju)) & 1)) {
      if (ans == -1) ans = max(id, ju);
      ans = min(ans, max(id, ju));
    }
  }
  if (r % a == 0 && u % b == 0) {
    int id = r / a;
    int ju = u / b;
    if (id == ju) {
      if (ans == -1)
        ans = id;
      else
        ans = min(id, ans);
    }
    if (!((max(id, ju) - min(id, ju)) & 1)) {
      if (ans == -1) ans = max(id, ju);
      ans = min(ans, max(id, ju));
    }
  }
  if (ans != -1)
    cout << ans << endl;
  else
    cout << "Poor Inna and pony!" << endl;
  return 0;
}
