Boring Problem
You are given a string of length . Let's define a function from a string:
Here denotes a distance between characters and in alphabet. In other words, denotes sum of over all . Then, let
Here denotes substring of string from index to . In other words, denotes sum of over all .
You are given queries. Each query changes the element at position to , i.e., . You need to print mod
before all queries and after each query.
Input
The first line of input contains a single integer () — the length of the string .
The second line of input contains a string of length .
The third line of input contains a single integer () — the number of queries.
The following lines contain an integer () and character () — description of queries.
Output
Print integers in separate lines — answers for the problem.
Examples
Scoring
( points): ;
( points): ;
( points): ;
( points): ;
( points): ;
( points): ;
( points): "n";
( points): ;
( points): no additional restrictions.