Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register
Language:
Rubik's Cube: 0-1 Version
Time Limit: 1000MSMemory Limit: 65536K
Total Submissions: 316Accepted: 50Special Judge

Description

Rubik's Cube is one of the most popular toys in the world. For convenience, let's mark the six faces by 1 to 6 and its expanded view is illustrated in Fig-1. Fig-2 shows the 18 possible moves. This problem considers a variation of Rubik's Cube. In our cube, the 54 stickers are marked by either 0 or 1, instead of six colors. Given the expanded view of a cube, your task is to take several moves that makes all the stickers marked by 1 located on the face marked by 1.

Fig-1

Fig-2

Input

The expanded view of the cube.

Output

Print “yes” or “no” in the first line to indicate “the task could be done” or “the task is impossible”. When “yes” is printed, the second line should be an integer T, the number of moves you take. The following T lines describe your moves by its number as in Fig-2. Any answer with T ≤ 10000 is available.

Sample Input

   000
   000
   000
000100000000
000100000000
000100000000
   011
   011
   011

Sample Output

yes
1
8

Source

[Submit]   [Go Back]   [Status]   [Discuss]

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator