There is a device in Inazuma, like the picture shows. It contains some stones and each stone has one to three gleamy petals on it. If one stone is knocked, the gleamy petals on it and the adjacent stone will change as follow: 1->2 2->3 3->1 When the numbers of gleamy petals on each stone come to equal, an exquisite treasure box will appear as reward. luckly, the scholars in Sumeru created a machine which can run various codes. The traveller recorded the number of gleamy petals on each stone and came to Sumeru to get solution by the machine. However, the traveller doesn't know how to write code. Can you help to write a program which can tell the traveller how to make all the stones have the same number of the gleamy petals?
There is a device in Inazuma, like the picture shows. It contains some stones(placed in a line) and each stone has one to three gleamy petals on it. If one stone is knocked, the gleamy petals on it and the adjacent stone(if has) will change as follow: 1->2 2->3 3->1 When the numbers of gleamy petals on each stone come to equal, an exquisite treasure box will appear as reward. luckly, the scholars in Sumeru(The Kingdom of Wisdom) created a machine which can run various codes(include c++, java and so on). The traveller recorded the number of gleamy petals on each stone and came to Sumeru to get solution by the machine. However, the traveller doesn't know how to write code. Can you help to write a program which can tell the traveller how to make all the stones have the same number of the gleamy petals?