public static void main ( String [ ] args ) {
  MyScanner sc = new MyScanner ( ) ;
  int n = sc . nextInt ( ) ;
  int m = sc . nextInt ( ) ;
  int sx = sc . nextInt ( ) ;
  int sy = sc . nextInt ( ) ;
  for ( int j = sy ;
  j <= m ;
  j ++ ) {
    System . out . println ( sx + " " + j ) ;
  }
  for ( int j = sy - 1 ;
  j >= 1 ;
  j -- ) {
    System . out . println ( sx + " " + j ) ;
  }
  boolean start = false ;
  for ( int i = 1 ;
  i <= n ;
  i ++ ) {
    if ( i == sx ) {
      continue ;
    }
    if ( ! start ) {
      for ( int j = 1 ;
      j <= m ;
      j ++ ) {
        System . out . println ( i + " " + j ) ;
      }
    }
    else {
      for ( int j = m ;
      j >= 1 ;
      j -- ) {
        System . out . println ( i + " " + j ) ;
      }
    }
    start = ! start ;
  }
}

public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int sx = sc . nextInt ( ) ; int sy = sc . nextInt ( ) ; for ( int j = sy ; j <= m ; j ++ ) { System . out . println ( sx + " ▁ " + j ) ; } for ( int j = sy - 1 ; j >= 1 ; j -- ) { System . out . println ( sx + " ▁ " + j ) ; } boolean start = false ; for ( int i = 1 ; i <= n ; i ++ ) { if ( i == sx ) { continue ; } if ( ! start ) { for ( int j = 1 ; j <= m ; j ++ ) { System . out . println ( i + " ▁ " + j ) ; } } else { for ( int j = m ; j >= 1 ; j -- ) { System . out . println ( i + " ▁ " + j ) ; } } start = ! start ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_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)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier))))))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (continue_statement))) (if_statement condition: (parenthesized_expression (unary_expression operand: (identifier))) consequence: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)))))))) alternative: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier))))))))) (expression_statement (assignment_expression left: (identifier) right: (unary_expression operand: (identifier))))))))