The first line contains an integer $n$, denoting the number of instructions in the program ($1 \le n \le 2000$).

The $i$-th of the following $n$ lines describes instruction $i$ and contains three tokens. The first token is either `\texttt{+}' or `\texttt{=}', denoting the type of the instruction. The second token is an integer $v$, denoting the argument of the instruction ($1 \le v \le 500$). Finally, the third token is either ``\texttt{async}'' if the instruction is marked as asynchronous, or ``\texttt{sync}'' otherwise.