## Problem

### Description

To The Moon is a independent game released in November 2011, it is a role-playing adventure game powered by RPG Maker.
The premise of To The Moon is based around a technology that allows us to permanently reconstruct the memory on dying man. In this problem, we’ll give you a chance, to implement the logic behind the scene.
You‘ve been given integers . On these integers, you need to implement the following operations:

1. : Adding a constant d for every , and increase the time stamp by , this is the only operation that will cause the time stamp increase.
2. : Querying the current sum of .
3. : Querying a history sum of in time .
4. : Back to time . And once you decide return to a past, you can never be access to a forward edition anymore.

, , , . The system start from time , and the first modification is in time , , and won’t introduce you to a future state.