public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int A = sc . nextInt ( ) ;
  int B = sc . nextInt ( ) ;
  int C = sc . nextInt ( ) ;
  int D = sc . nextInt ( ) ;
  int E = sc . nextInt ( ) ;
  int F = sc . nextInt ( ) ;
  int ansX = 100 * A ;
  int ansY = 0 ;
  int maxP = 0 ;
  int maxQ = 1 ;
  for ( int ai = 0 ;
  ai * 100 <= F ;
  ai += A ) {
    int a = ai * 100 ;
    for ( int bi = 0 ;
    a + 100 * bi <= F ;
    bi += B ) {
      int b = bi * 100 ;
      for ( int c = 0 ;
      a + b + c <= F ;
      c += C ) {
        for ( int d = 0 ;
        a + b + c + d <= F ;
        d += D ) {
          if ( ( ai + bi ) * E < c + d ) {
            continue ;
          }
          int water = a + b ;
          int sugar = c + d ;
          if ( isGreater ( sugar * 100 , water + sugar , maxP , maxQ ) ) {
            maxP = sugar * 100 ;
            maxQ = water + sugar ;
            ansX = water + sugar ;
            ansY = sugar ;
          }
        }
      }
    }
  }
  System . out . println ( ansX + " " + ansY ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; int E = sc . nextInt ( ) ; int F = sc . nextInt ( ) ; int ansX = 100 * A ; int ansY = 0 ; int maxP = 0 ; int maxQ = 1 ; for ( int ai = 0 ; ai * 100 <= F ; ai += A ) { int a = ai * 100 ; for ( int bi = 0 ; a + 100 * bi <= F ; bi += B ) { int b = bi * 100 ; for ( int c = 0 ; a + b + c <= F ; c += C ) { for ( int d = 0 ; a + b + c + d <= F ; d += D ) { if ( ( ai + bi ) * E < c + d ) { continue ; } int water = a + b ; int sugar = c + d ; if ( isGreater ( sugar * 100 , water + sugar , maxP , maxQ ) ) { maxP = sugar * 100 ; maxQ = water + sugar ; ansX = water + sugar ; ansY = sugar ; } } } } } System . out . println ( ansX + " ▁ " + ansY ) ; }
(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 (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: (binary_expression left: (decimal_integer_literal) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)) update: (assignment_expression left: (identifier) right: (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (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: (binary_expression left: (identifier) right: (binary_expression left: (decimal_integer_literal) right: (identifier))) right: (identifier)) update: (assignment_expression left: (identifier) right: (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (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: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (identifier)) update: (assignment_expression left: (identifier) right: (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (identifier)) right: (identifier)) update: (assignment_expression left: (identifier) right: (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (continue_statement))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (identifier)) (identifier) (identifier)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (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 (assignment_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: (identifier) right: (string_literal)) right: (identifier)))))))