Input is made of two lines, the first line is number n ( 2<=n<=2
10 , n even). The number n is the size of images, one image is represented internally by a n x n pixel matrix (a
ji) , where i is the row number and j is the column number. The pixel at the upper left corner is at row 0 and column 0.
The second line is a non-empty list of at most 32 words, separated by spaces. Valid words are the keywords id, rot, sym, bhsym, bvsym, div and mix, or a keyword followed by ``-". Each keyword key designates an elementary transform (as defined by Figure 1), and key- designates the inverse of transform key. For instance, rot- is the inverse of counter-clockwise 90
o rotation, that is clockwise 90
o rotation. Finally, the list k1, k2,..., kp designates the compound transform φ = k
1ok
2o ... ok
p . For instance, ``bvsym rot-" is the transform that first performs clockwise 90
o rotation and then vertical symmetry on the lower half of the image.