public static void main ( String [ ] args ) throws Exception {
  BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
  String s = br . readLine ( ) ;
  String str [ ] = s . split ( " " ) ;
  int n = Integer . parseInt ( str [ 0 ] ) ;
  int m = Integer . parseInt ( str [ 1 ] ) ;
  int i = Integer . parseInt ( str [ 2 ] ) ;
  int j = Integer . parseInt ( str [ 3 ] ) ;
  int a = Integer . parseInt ( str [ 4 ] ) ;
  int b = Integer . parseInt ( str [ 5 ] ) ;
  int ar1 [ ] = {
    1 , n , n , 1 };
    int ar2 [ ] = {
      m , 1 , m , 1 };
      int min = - 1 ;
      for ( int l = 0 ;
      l < 4 ;
      l ++ ) {
        int temp1 = Math . abs ( ar1 [ l ] - i ) ;
        int temp2 = Math . abs ( ar2 [ l ] - j ) ;
        if ( temp1 % a != 0 || temp2 % b != 0 ) continue ;
        temp1 /= a ;
        temp2 /= b ;
        if ( temp1 % 2 != temp2 % 2 ) continue ;
        int d = Math . max ( temp1 , temp2 ) ;
        if ( min == - 1 || d < min ) min = d ;
      }
      if ( a + i > n && i - a <= 0 && min != 0 || b + j > m && j - b <= 0 && min != 0 ) System . out . println ( "Poor Inna and pony!" ) ;
      else if ( min == - 1 ) System . out . println ( "Poor Inna and pony!" ) ;
      else System . out . println ( min ) ;
    }
    
public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = br . readLine ( ) ; String str [ ] = s . split ( " ▁ " ) ; int n = Integer . parseInt ( str [ 0 ] ) ; int m = Integer . parseInt ( str [ 1 ] ) ; int i = Integer . parseInt ( str [ 2 ] ) ; int j = Integer . parseInt ( str [ 3 ] ) ; int a = Integer . parseInt ( str [ 4 ] ) ; int b = Integer . parseInt ( str [ 5 ] ) ; int ar1 [ ] = { 1 , n , n , 1 } ; int ar2 [ ] = { m , 1 , m , 1 } ; int min = - 1 ; for ( int l = 0 ; l < 4 ; l ++ ) { int temp1 = Math . abs ( ar1 [ l ] - i ) ; int temp2 = Math . abs ( ar2 [ l ] - j ) ; if ( temp1 % a != 0 || temp2 % b != 0 ) continue ; temp1 /= a ; temp2 /= b ; if ( temp1 % 2 != temp2 % 2 ) continue ; int d = Math . max ( temp1 , temp2 ) ; if ( min == - 1 || d < min ) min = d ; } if ( a + i > n && i - a <= 0 && min != 0 || b + j > m && j - b <= 0 && min != 0 ) System . out . println ( " Poor ▁ Inna ▁ and ▁ pony ! " ) ; else if ( min == - 1 ) System . out . println ( " Poor ▁ Inna ▁ and ▁ pony ! " ) ; else System . out . println ( min ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_initializer (decimal_integer_literal) (identifier) (identifier) (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_initializer (identifier) (decimal_integer_literal) (identifier) (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) consequence: (continue_statement)) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (continue_statement)) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal))))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))))