System Administrator
System administrators Andriy and Serhiy are tasked with managing malfunctions in the LKShenyan computer room daily. To streamline their work, they've devised a specific protocol to follow.
The computers are conveniently numbered from 1 to n. Andriy is responsible for servicing computers with even numbers, while Serhiy handles those with odd numbers. Occasionally, the LKShenyan network monitoring system alerts them to malfunctions.
The administrators believe that each computer possesses its own spiritual energy. When a malfunction is reported, the monitoring system specifies that the computers in the range l to r need an energy boost of x. Following each alert, one of the administrators attends to the entire segment, using their unique methods (Andriy for even-numbered and Serhiy for odd-numbered computers) to restore the required energy. Initially, all computers have zero spiritual energy.
However, disruptions occur when students, rushing through the computer room, disturb the spiritual balance of the computers. As they move through the segment l to r, they decrease the energy of each computer in that range (by pressing keys randomly, knocking on them, etc.). The monitoring system promptly notifies the administrators of these disturbances. It is crucial for Serhiy and Andriy to determine the total remaining energy on all computers in the segment after each student interference.
Your task is to assist the system administrators by developing a module for the monitoring system that accurately tracks the spiritual energy of the computers.
Input
The first line of the input contains two integers 1 ≤ n, m ≤ 100000. The following m lines contain messages from the monitoring system in the format:
S l r x: Serhiy needs to increase the spiritual energy of computers in the segment l to r by x.
A l r x: Andriy needs to increase the spiritual energy of computers in the segment l to r by x.
U l r x: Students have decreased the energy of each computer in the segment l to r by x.
The monitoring system is reliable, ensuring that for all messages 1 ≤ l ≤ r ≤ n. Additionally, the value x does not exceed 10^5 and is always positive.
Output
For each message of type U l r x, output a separate line indicating the total remaining spiritual energy on all computers in the segment l to r after the student disruption.