\problemname{Long Long Strings}

\illustration{0.3}{longlongstrings/problem_statement/strings-bw.png}

To store DNA sequences your company has developed a LongLongString
class that can store strings with up to ten billion characters.
The class supports two basic operations:
\begin{itemize}
\item {\tt Ins($p$, $c$)}: Insert the character $c$ at position $p$.
\item {\tt Del($p$)}: Delete the character at position $p$.
\end{itemize}

A DNA editing program is written as a series of {\tt Ins} and {\tt Del} operations.
Your job is to write a program that compare two DNA editing programs
and determine if they are identical,
\emph{i.e.}, when applied to any sufficiently long string,
whether the end result is the same.

For example:
\begin{itemize}
	\item {\tt Del(1) Del(2)} and {\tt Del(3) Del(1)} are identical.
	\item {\tt Del(2) Del(1)} and {\tt Del(1) Del(2)} are different.
	\item An empty sequence and {\tt Ins(1, $X$) Del(1)} are identical.
	\item {\tt Ins(14, $B$) Ins(14, $A$)} and {\tt Ins(14, $A$) Ins(15, $B$)} are identical.
	\item {\tt Ins(14, $A$) Ins(15, $B$)} and {\tt Ins(14, $B$) Ins(15, $A$)} are different.
\end{itemize}

\section*{Input}

Input will consist of the descriptions of two DNA editing programs.

Each program will consist of
some number of operations (between $0$ and $2\,000$).
Each operation will be given on its own line.
The first character of the line will be {\tt D} for a {\tt Del} operation,
{\tt I} for an {\tt Ins} operation, or {\tt E} marking the end of the
program.

A {\tt Del} operation will have the {\tt D} character, followed by a
space, and then a single integer between $1$ and $10^{10}$, indicating
the character position to delete. All characters after this deleted
character will be shifted one position lower.

An {\tt Ins} operation will have the {\tt I} character, followed
by a space, and then a single integer between $1$ and $10^{10}$, indicating
the location to insert the new character; all pre-existing characters
with this index and higher will be shifted one position higher.
Following this integer will be another space and then an uppercase
alphabetic character that is the character to insert.

\section*{Output}

If the two programs are identical, print ``{\tt 0}'' on a single line (without quotation marks).
Otherwise, print ``{\tt 1}'' on a single line (without quotation marks).

~

\textit{Time limit}: solutions should complete in no more than $3$ CPU seconds


\section*{Examples}

