#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int n, m, first, second, a, b;
int calc(int first, int second) {
  int res = INF;
  if (first % a != 0 || second % b != 0) return res;
  if (abs(first / a - second / b) & 1) return res;
  if ((first / a < second / b && first - a + 1 <= 0 && first + a + 1 > n) ||
      (first / a > second / b && second - b + 1 <= 0 && second + b + 1 > m))
    return res;
  return max(first / a, second / b);
}
int main() {
  cin >> n >> m >> first >> second >> a >> b;
  int Tohka =
      min(min(calc(first - 1, second - 1), calc(n - first, second - 1)),
          min(calc(first - 1, m - second), calc(n - first, m - second)));
  if (Tohka == INF)
    puts("Poor Inna and pony!");
  else
    cout << Tohka << endl;
  fclose(stdin);
  fclose(stdout);
  return 0;
}
