LowbieH implements a powerful editor for integer sequences.
The sequence is empty when the editor is initialized.
LowbieH creates 5 types of instructions for the editor:
\(I \ x\) Insert x after the cursor.
\(D\) Delete the element before the cursor
\(L\) Move the cursor left. If the cursor has already been at the begin of the sequence, it will not move.
\(R\) Move the cursor right. If the cursor has already been at the end of the sequence, it will not move.
\(Q \ k\) Suppose that the current sequence \(BEFORE \ the \ cursor\) is {\(a_1\),\(a_2\),...\(a_n\)}. Find \(max_{1 \le i\le k}S_i\) where \(S_i = a_1 + a_2 + .. + a_i\)