#include <bits/stdc++.h>
using namespace std;
int main() {
  pair<int, int> c1, c2, c3, c4;
  int m, n;
  cin >> m >> n;
  int i, j, a, b;
  cin >> i >> j;
  cin >> a >> b;
  c1.first = i - 1;
  c1.second = j - 1;
  c2.first = m - i;
  c2.second = j - 1;
  c3.first = m - i;
  c3.second = n - j;
  c4.first = i - 1;
  c4.second = n - j;
  int moves = INT_MAX;
  if (c1.first % a == 0 && c1.second % b == 0) {
    c1.first /= a;
    c1.second /= b;
    if ((c1.first + c1.second) % 2 == 0) {
      moves = min(moves, max(c1.first, c1.second));
    }
  }
  if (c2.first % a == 0 && c2.second % b == 0) {
    c2.first /= a;
    c2.second /= b;
    if ((c2.first + c2.second) % 2 == 0) {
      moves = min(moves, max(c2.first, c2.second));
    }
  }
  if (c3.first % a == 0 && c3.second % b == 0) {
    c3.first /= a;
    c3.second /= b;
    if ((c3.first + c3.second) % 2 == 0) {
      moves = min(moves, max(c3.first, c3.second));
    }
  }
  if (c4.first % a == 0 && c4.second % b == 0) {
    c4.first /= a;
    c4.second /= b;
    if ((c4.first + c4.second) % 2 == 0) {
      moves = min(moves, max(c4.first, c4.second));
    }
  }
  if (moves == INT_MAX or
      ((i + a > m and i - a < 1) or (j + b > n and j - b < 1)) and moves != 0) {
    cout << "Poor Inna and pony!";
  } else
    cout << moves;
  return 0;
}
