Regular expressions are a flexible way to define patterns for searching and replacing text. In this problem, we consider a subset of regular expressions that includes only:
One of the applications of regular expressions is to check whether a string matches a given pattern. For example, to check whether an entered non-negative integer is even, you can write the following expression (leading zeros are allowed for simplicity): (0|1|2|3|4|5|6|7|8|9)*(0|2|4|6|8)
Your task is to solve a more complex problem. You need to determine whether it is possible to rearrange the digits in a non-negative integer so that the number is divisible by 6. For example, in the number 123, the digits can be rearranged in the required way, but in the number 31, they cannot. Write a regular expression to perform this check.
There is no input data.
Output one string of no more than 3000 characters, containing the desired regular expression. The string may only use the characters listed above.
The correctness of your regular expression will be checked on various integers in the range from $$$0$$$ to $$$10^9$$$ inclusive (without leading zeros). The regex_match function from the regex library of the C++ language (GCC compiler) will be used for testing. The testing time should not exceed one second (in case of exceeding, the verdict 'Wrong answer' will be returned).
For information: the first test checks the number 123, the second — 31.
| Name |
|---|


