#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, a, b, ok, sum, cnt;
vector<int> v;
int main() {
  cin >> n >> m >> x >> y >> a >> b;
  if (x == 1 && y == m || x == n && y == 1 || x == n && y == m ||
      x == 1 && y == 1) {
    cout << 0;
    return 0;
  }
  if (x - a < 1 && x + a > n) {
    cout << "Poor Inna and pony!";
    return 0;
  }
  if (y - b < 1 && y + b > m) {
    cout << "Poor Inna and pony!";
    return 0;
  }
  if (abs(n - x) % a == 0 && abs(m - y) % b == 0 &&
      (abs(n - x) / a) % 2 == (abs(m - y) / b) % 2) {
    v.push_back(max((abs(n - x) / a), (abs(m - y) / b)));
  }
  if (abs(1 - x) % a == 0 && abs(1 - y) % b == 0 &&
      (abs(1 - x) / a) % 2 == (abs(1 - y) / b) % 2) {
    v.push_back(max((abs(1 - x) / a), (abs(1 - y) / b)));
  }
  if (abs(n - x) % a == 0 && abs(1 - y) % b == 0 &&
      (abs(n - x) / a) % 2 == (abs(1 - y) / b) % 2) {
    v.push_back(max((abs(n - x) / a), (abs(1 - y) / b)));
  }
  if (abs(1 - x) % a == 0 && abs(m - y) % b == 0 &&
      (abs(1 - x) / a) % 2 == (abs(m - y) / b) % 2) {
    v.push_back(max((abs(1 - x) / a), (abs(m - y) / b)));
  }
  if (!v.size()) {
    cout << "Poor Inna and pony!";
    return 0;
  }
  sort(v.begin(), v.end());
  cout << v[0];
}
