#C9756. String Update Operations

    ID: 53884 Type: Default 1000ms 256MiB

String Update Operations

String Update Operations

Given an initial string and a series of update operations, your task is to update the string accordingly and output the final string. Each update operation specifies a one-indexed position and a character to replace the character at that position. For example, if the string is ( s = \texttt{abcdef} ) and an update ( (1, 'z') ) is applied, the string becomes ( \texttt{zbcdef} ). Please note that positions are indexed starting from 1, i.e., ( 1 \leq pos \leq |s| ).

inputFormat

Input is given in standard input (stdin). The first line contains the initial string ( s ). The second line contains an integer ( n ), representing the number of update operations. Each of the following ( n ) lines contains two tokens: an integer ( pos ) and a character ( c ), separated by a space, indicating that the character at position ( pos ) in the string should be replaced with ( c ).

outputFormat

Output the final string after applying all the update operations. The output should be written to standard output (stdout).## sample

abcdef
0
abcdef