European countries use a 12-digit code called European Article Number (EAN) for each product. Each EAN ends with a check digit, which is calculated by the following rules:
Add the second, fourth, sixth, eighth, tenth, and twelfth digits (as $a$).
Add the first, third, fifth, seventh, ninth, and eleventh digits (as $b$).
Multiply $a$ by $3$ and add it to $b$ (as $x$).
Subtract $1$ from $x$ ( as $y$).
Compute the remainder when $y$ is divided by $10$ (as $z$).
Substract $z$ from $9$.
Write a program that reads the first 12 digits of an EAN, and then displays the calculated check digit.
|No.||Time Limit (ms)||Memory Limit (KiB)||Output Limit (KiB)||Subtasks|