public static void main ( String [ ] $ ) {
  int a = getInt ( ) , b = getInt ( ) , c = getInt ( ) , d = getInt ( ) , e = getInt ( ) , f = getInt ( ) ;
  int rw = 100 * a , rs = 0 ;
  double max = 0 ;
  for ( int i = 0 ;
  true ;
  ++ i ) {
    int va = 100 * a * i ;
    if ( va > f ) break ;
    for ( int j = 0 ;
    true ;
    ++ j ) {
      int vb = 100 * b * j ;
      if ( va + vb > f ) break ;
      for ( int k = 0 ;
      true ;
      ++ k ) {
        int vc = c * k ;
        if ( va + vb + vc > f ) break ;
        for ( int l = 0 ;
        true ;
        ++ l ) {
          int vd = d * l ;
          if ( va + vb + vc + vd > f ) break ;
          if ( max < calc ( va + vb , vc + vd , e ) ) {
            max = calc ( va + vb , vc + vd , e ) ;
            rw = va + vb ;
            rs = vc + vd ;
          }
        }
      }
    }
  }
  System . out . println ( rw + rs + " " + rs ) ;
}

public static void main ( String [ ] $ ) { int a = getInt ( ) , b = getInt ( ) , c = getInt ( ) , d = getInt ( ) , e = getInt ( ) , f = getInt ( ) ; int rw = 100 * a , rs = 0 ; double max = 0 ; for ( int i = 0 ; true ; ++ i ) { int va = 100 * a * i ; if ( va > f ) break ; for ( int j = 0 ; true ; ++ j ) { int vb = 100 * b * j ; if ( va + vb > f ) break ; for ( int k = 0 ; true ; ++ k ) { int vc = c * k ; if ( va + vb + vc > f ) break ; for ( int l = 0 ; true ; ++ l ) { int vd = d * l ; if ( va + vb + vc + vd > f ) break ; if ( max < calc ( va + vb , vc + vd , e ) ) { max = calc ( va + vb , vc + vd , e ) ; rw = va + vb ; rs = vc + vd ; } } } } } System . out . println ( rw + rs + " ▁ " + rs ) ; }
(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: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (decimal_integer_literal) right: (identifier))) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (floating_point_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: (true) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (break_statement)) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (true) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) consequence: (break_statement)) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (true) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (identifier))) consequence: (break_statement)) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (true) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (identifier)) right: (identifier))) consequence: (break_statement)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)) (binary_expression left: (identifier) right: (identifier)) (identifier))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)) (binary_expression left: (identifier) right: (identifier)) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))))))))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (string_literal)) right: (identifier)))))))