What is the template?
Arithmetic expressions can be expressed in a bracket-free format. In this format, if the operator follows the operands, it's called postfix notation, and if it precedes the operands, it's called prefix notation. For example, the expression a-b*c would be written as abc*- in postfix notation and as -a*bc in prefix notation.
A template for a bracket-free arithmetic expression consists of a sequence made up of the digits 0, 1, 2, and 3. Here, 0 represents an operand, while the other digits represent operations. The value of each digit indicates the number of operands required for the corresponding operation.
Given a sequence of the digits 0, 1, 2, and 3, your task is to determine if it forms a valid postfix notation template. If it does, output OK. If not, output ERROR IN K, where K is the index of the first character in the sequence after which it cannot be corrected. The sequence is indexed from left to right, starting at zero. If there is no specific erroneous character but the sequence is still invalid, K should be the index the next character would have if it were appended to the end of the sequence.
Input
The input consists of a single line containing the initial sequence. This template is provided as a string of the characters '0', '1', '2', '3', written consecutively. The string's length does not exceed 101000.
Output
Output a single line with the solution to the problem.