public static String process ( TestCase testCase ) {
  final String s = testCase . s ;
  final int K = testCase . K ;
  TreeSet < String > set = new TreeSet < > ( ) ;
  final int length = s . length ( ) ;
  IntStream . range ( 0 , K + 1 ) . forEach ( i -> IntStream . range ( 0 , length - i ) . forEach ( j -> set . add ( s . substring ( j , j + i + 1 ) ) ) ) ;
  return new ArrayList < > ( set ) . get ( K - 1 ) ;
}

public static String process ( TestCase testCase ) { final String s = testCase . s ; final int K = testCase . K ; TreeSet < String > set = new TreeSet < > ( ) ; final int length = s . length ( ) ; IntStream . range ( 0 , K + 1 ) . forEach ( i -> IntStream . range ( 0 , length - i ) . forEach ( j -> set . add ( s . substring ( j , j + i + 1 ) ) ) ) ; return new ArrayList < > ( set ) . get ( K - 1 ) ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration (modifiers) type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration (modifiers) type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (local_variable_declaration (modifiers) type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (decimal_integer_literal)))) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (identifier)))) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))))))))))))) (return_statement (method_invocation object: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))))))