After bouncing several checks last month, you decide to finally take control of your finances. Your bank now posts your monthly statement online, and you want to reconcile it against your own checkbook register so that you always keep enough money to cover the checks you write.
The bank's monthly statement lists your starting balance, every transaction, and your final balance. Your job is to compare that statement against the transactions you recorded in your register over the same period. For each register entry you must detect transactions that appear in only one of the two, amounts you copied down incorrectly (the bank statement is always correct), and arithmetic mistakes in the register's running balance.
The bank statement comes first. It begins and ends with a line of the form:
balance <X>
The first such line is the starting balance and the second is the final balance. Between them, each transaction is listed on its own line:
{check|deposit} <N> <X>
N is the integer check or deposit number and X is the amount. A given number appears at most once as a check and at most once as a deposit, so the same number may label both a check and a deposit.
After the final balance line, the register follows. Its first line is the register's starting balance:
<X>
After that come pairs of lines: a transaction, followed by the running balance you computed by hand after entering that transaction.
{check|deposit} <N> <X>
<X>
The pairs repeat until end of input. Every amount and intermediate value satisfies $|X| < 1000000$, and all amounts are given to the penny (a multiple of $0.01$). A check lowers the balance and a deposit raises it.
Read the register entries in order and print exactly one line for each.
A register entry is entirely correct when it is found in the statement with the same amount, its running-balance arithmetic is right, and it is not a repeat of a transaction already seen earlier in the register. For such an entry, print:
{check|deposit} <N> is correct
Otherwise, print a line that begins with the transaction type and number, followed by one or more of the messages below, separated by single spaces, in exactly this order:
is not in statement — this transaction type and number do not occur in the statement.repeated transaction — this transaction already occurred earlier in the register.incorrect amount — the register's amount differs from the statement's amount.math uses correct value — the running balance was computed from the statement's amount even though the register recorded the amount incorrectly. It can appear only together with incorrect amount.math mistake — the running balance after this transaction matches neither the value implied by the statement's amount nor the value implied by the register's own recorded amount.After the line for the last register entry, list every statement transaction that never appears in the register, one per line, in the order they appear in the statement:
missed {check|deposit} <N>