无解时输出-1s而不是WTF
数据可能有前导零
Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 512 mebibytesA positive integer number n is written on a blackboard. It consists of not more than 10^5105 digits. You have to transform it into a mogicalnumber by erasing some of the digits, and you want to erase as few digits as possible.
The number is lucky if it consists of at least one digit, doesn't have leading zeroes and is a multiple of 6. For example, 0, 66,66666 are lucky numbers, and 00, 25, 77 are not.
Write a program which for the given nn will find a mogical number such that nn can be transformed into this number by erasing as few digits as possible. You can erase an arbitraty set of digits. For example, they don't have to go one after another in the number nn.
Print the length of your answer after the erasing.
If it's impossible to obtain a lucky number, print -1s.
The first line of input contains nn -- a positive integer ( 1\le n \le 10^{100000}1≤n≤10100000 ).
Print one number — the number of your lucky number obtained by erasing as few as possible digits. If there is no answer, print -1s.