public static void main ( String [ ] args ) {
  FastReader in = new FastReader ( ) ;
  int n = in . nextInt ( ) , k = in . nextInt ( ) ;
  int [ ] arr = in . readArray ( n ) ;
  long [ ] pre = new long [ n - k + 1 ] ;
  Pair [ ] dp = new Pair [ n - k + 1 ] ;
  long ans = 0 ;
  for ( int i = 0 ;
  i < k ;
  i ++ ) {
    ans += arr [ i ] ;
  }
  pre [ 0 ] = ans ;
  for ( int i = 1 ;
  i <= n - k ;
  i ++ ) {
    ans -= arr [ i - 1 ] ;
    ans += arr [ i + k - 1 ] ;
    pre [ i ] = ans ;
  }
  dp [ dp . length - 1 ] = new Pair ( pre [ n - k ] , n - k + 1 ) ;
  for ( int i = pre . length - 2 ;
  i >= 0 ;
  i -- ) {
    if ( pre [ i ] >= dp [ i + 1 ] . a ) dp [ i ] = new Pair ( pre [ i ] , i + 1 ) ;
    else dp [ i ] = dp [ i + 1 ] ;
  }
  ans = 0 ;
  int first = - 1 , second = - 1 ;
  for ( int i = 0 ;
  i <= n - 2 * k ;
  i ++ ) {
    if ( ans < pre [ i ] + dp [ i + k ] . a ) {
      ans = pre [ i ] + dp [ i + k ] . a ;
      first = i + 1 ;
      second = ( int ) dp [ i + k ] . b ;
    }
  }
  System . out . println ( first + " " + second ) ;
}

public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; int n = in . nextInt ( ) , k = in . nextInt ( ) ; int [ ] arr = in . readArray ( n ) ; long [ ] pre = new long [ n - k + 1 ] ; Pair [ ] dp = new Pair [ n - k + 1 ] ; long ans = 0 ; for ( int i = 0 ; i < k ; i ++ ) { ans += arr [ i ] ; } pre [ 0 ] = ans ; for ( int i = 1 ; i <= n - k ; i ++ ) { ans -= arr [ i - 1 ] ; ans += arr [ i + k - 1 ] ; pre [ i ] = ans ; } dp [ dp . length - 1 ] = new Pair ( pre [ n - k ] , n - k + 1 ) ; for ( int i = pre . length - 2 ; i >= 0 ; i -- ) { if ( pre [ i ] >= dp [ i + 1 ] . a ) dp [ i ] = new Pair ( pre [ i ] , i + 1 ) ; else dp [ i ] = dp [ i + 1 ] ; } ans = 0 ; int first = - 1 , second = - 1 ; for ( int i = 0 ; i <= n - 2 * k ; i ++ ) { if ( ans < pre [ i ] + dp [ i + k ] . a ) { ans = pre [ i ] + dp [ i + k ] . a ; first = i + 1 ; second = ( int ) dp [ i + k ] . b ; } } System . out . println ( first + " ▁ " + second ) ; }
(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))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) (local_variable_declaration type: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (type_identifier) dimensions: (dimensions_expr (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (field_access object: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) field: (identifier)))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) alternative: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal))) 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: (binary_expression left: (identifier) right: (binary_expression left: (decimal_integer_literal) right: (identifier)))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (field_access object: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) field: (identifier))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (field_access object: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) field: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (field_access object: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) field: (identifier))))))))) (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)))))))