#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, a, b;
int tot() {
  int minn = INT_MAX;
  if (abs(i - 1) % a == 0 && abs(j - 1) % b == 0 &&
      (abs(i - 1) / a) % 2 == (abs(j - 1) / b) % 2 &&
      minn > max(abs(i - 1) / a, abs(j - 1) / b))
    minn = max(abs(i - 1) / a, abs(j - 1) / b);
  if (abs(n - i) % a == 0 && abs(j - 1) % b == 0 &&
      (abs(n - i) / a) % 2 == (abs(j - 1) / b) % 2 &&
      minn > max(abs(n - i) / a, abs(j - 1) / b))
    minn = max(abs(n - i) / a, abs(j - 1) / b);
  if (abs(i - 1) % a == 0 && abs(m - j) % b == 0 &&
      (abs(i - 1) / a) % 2 == (abs(m - j) / b) % 2 &&
      minn > max(abs(i - 1) / a, abs(m - j) / b))
    minn = max(abs(i - 1) / a, abs(m - j) / b);
  if (abs(n - i) % a == 0 && abs(m - j) % b == 0 &&
      (abs(n - i) / a) % 2 == (abs(m - j) / b) % 2 &&
      minn > max(abs(n - i) / a, abs(m - j) / b))
    minn = max(abs(n - i) / a, abs(m - j) / b);
  return minn;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> i >> j >> a >> b;
  int x = tot();
  if ((x > 0) && (n <= a || m <= b))
    cout << "Poor Inna and pony!";
  else if (x == INT_MAX)
    cout << "Poor Inna and pony!";
  else
    cout << x;
  return 0;
}
