public static void main ( String args [ ] ) {
  Scanner sc = new Scanner ( System . in ) ;
  int n = sc . nextInt ( ) ;
  int m = sc . nextInt ( ) ;
  int i = sc . nextInt ( ) ;
  int j = sc . nextInt ( ) ;
  int a = sc . nextInt ( ) ;
  int b = sc . nextInt ( ) ;
  int ans = Integer . MAX_VALUE ;
  ans = Math . min ( ans , sol ( 1 , 1 , i , j , a , b ) ) ;
  ans = Math . min ( ans , sol ( 1 , m , i , j , a , b ) ) ;
  ans = Math . min ( ans , sol ( n , 1 , i , j , a , b ) ) ;
  ans = Math . min ( ans , sol ( n , m , i , j , a , b ) ) ;
  if ( ans == Integer . MAX_VALUE || ( ( i - a < 1 && i + a > n ) || ( j - b < 1 && j + b > m ) ) && ans != 0 ) {
    System . out . println ( "Poor Inna and pony!" ) ;
  }
  else {
    System . out . println ( ans ) ;
  }
}

public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int i = sc . nextInt ( ) ; int j = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int ans = Integer . MAX_VALUE ; ans = Math . min ( ans , sol ( 1 , 1 , i , j , a , b ) ) ; ans = Math . min ( ans , sol ( 1 , m , i , j , a , b ) ) ; ans = Math . min ( ans , sol ( n , 1 , i , j , a , b ) ) ; ans = Math . min ( ans , sol ( n , m , i , j , a , b ) ) ; if ( ans == Integer . MAX_VALUE || ( ( i - a < 1 && i + a > n ) || ( j - b < 1 && j + b > m ) ) && ans != 0 ) { System . out . println ( " Poor ▁ Inna ▁ and ▁ pony ! " ) ; } else { System . out . println ( ans ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal) (identifier) (identifier) (identifier) (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier) (identifier) (identifier) (identifier) (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal) (identifier) (identifier) (identifier) (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier) (identifier) (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) right: (binary_expression left: (parenthesized_expression (binary_expression left: (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: (identifier)))) right: (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: (identifier)))))) right: (binary_expression left: (identifier) right: (decimal_integer_literal))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))))