An image set to be painted onto a tartan canvas consists of $$$n$$$ rows of $$$m$$$ pixels with each colour represented as a lowercase letter of the alphabet.
You are going to paint the image using long brush strokes that cover either a whole row of $$$m$$$ pixels, or a whole column of $$$n$$$ pixels. Each brush stroke overwrites any pixels that were previously there. You must cover the whole canvas with brush strokes.
Is it possible to do so? If so, output a sequence of instructions of the form x=[1-m] [a-z] or y=[1-n] [a-z]. If there are multiple sequences, output any of the shortest possible lists of instructions.

Illustration of Sample Input 2.
On the first line, output the minimum number of instructions needed. If no sequence of instructions covers the canvas, output impossible and exit.
On each of the next lines, output one instruction to follow in order. For example, "x=5 z", and "y=100 b" are both valid instructions.
4 6aaaabaaaaabaaaaabaaaaaba
5 y=1 a y=2 a y=3 a y=4 a x=5 b
4 4laaqdaaqlaaqbbbq
6 x=1 l y=2 d x=2 a x=3 a y=4 b x=4 q