Given a string, determine if it qualifies as a "beautiful 5-record," according to the following rules:
<Beautiful 5-record>::=<NZED>|<NZED><EDS><ODS>
<NZED>::=2|4
<EDS>::= | <EDS><ED>
<ED>::= 0|<NZED>
<ODS>::= <OD>|<ODS><OD>
<OD>::= 1|3
In simpler terms, a "beautiful 5-record" is a base-5 number that must begin with a non-zero even base-5 digit. All even digits must appear at the start of the record, followed by any odd digits. If there are no odd digits, the record must be exactly one digit long.
The first line contains a record, without spaces, that needs to be checked to determine if it is a beautiful 5-record. The length of the string is no more than .
Provide the result of the input string analysis on a single line. If the string is a beautiful 5-record, output "OK". Otherwise, output "Error in pos: K", where is the position number, starting from , where it first becomes evident that the string is not a beautiful 5-record.
Example 1
Example 2
Example 3
Example 4