public static void solve ( ) {
  String s = in . next ( ) ;
  char chrs [ ] = s . toCharArray ( ) ;
  int m = in . nextInt ( ) ;
  for ( int i = 0 ;
  i < m ;
  ++ i ) {
    int startIndex = in . nextInt ( ) - 1 ;
    int endIndex = in . nextInt ( ) - 1 ;
    int k = in . nextInt ( ) ;
    int shiftSize = ( endIndex - startIndex ) + 1 ;
    int finalShiftOffset = k % shiftSize ;
    rotate ( chrs , startIndex , endIndex , finalShiftOffset ) ;
  }
  out . println ( new String ( chrs ) ) ;
}

public static void solve ( ) { String s = in . next ( ) ; char chrs [ ] = s . toCharArray ( ) ; int m = in . nextInt ( ) ; for ( int i = 0 ; i < m ; ++ i ) { int startIndex = in . nextInt ( ) - 1 ; int endIndex = in . nextInt ( ) - 1 ; int k = in . nextInt ( ) ; int shiftSize = ( endIndex - startIndex ) + 1 ; int finalShiftOffset = k % shiftSize ; rotate ( chrs , startIndex , endIndex , finalShiftOffset ) ; } out . println ( new String ( chrs ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) body: (block (local_variable_declaration type: (type_identifier) 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) dimensions: (dimensions) 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: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) (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: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))))))