{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eYou are given two pots, having the volume of \u003cb\u003eA\u003c/b\u003e and \u003cb\u003eB\u003c/b\u003e liters respectively. The following operations can be performed:\u003c/p\u003e\u003col\u003e\u003cli\u003eFILL(i)\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; fill the pot \u003cb\u003ei\u003c/b\u003e (1 ≤ \u003cb\u003ei \u003c/b\u003e≤ 2) from the tap;\u003c/li\u003e\u003cli\u003eDROP(i)\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; empty the pot \u003cb\u003ei\u003c/b\u003e to the drain;\u003c/li\u003e\u003cli\u003ePOUR(i,j)\u0026nbsp;\u0026nbsp;\u0026nbsp; pour from pot \u003cb\u003ei\u003c/b\u003e to pot \u003cb\u003ej\u003c/b\u003e; after this operation either the pot \u003cb\u003ej\u003c/b\u003e is full (and there may be some water left in the pot \u003cb\u003ei\u003c/b\u003e), or the pot \u003cb\u003ei\u003c/b\u003e is empty (and all its contents have been moved to the pot \u003cb\u003ej\u003c/b\u003e).\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eWrite a program to find the shortest possible sequence of these operations that will yield exactly \u003cb\u003eC\u003c/b\u003e liters of water in one of the pots.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eOn the first and only line are the numbers \u003cb\u003eA\u003c/b\u003e, \u003cb\u003eB\u003c/b\u003e, and \u003cb\u003eC\u003c/b\u003e. These are all integers in the range from 1 to 100 and \u003cb\u003eC\u003c/b\u003e≤max(\u003cb\u003eA\u003c/b\u003e,\u003cb\u003eB\u003c/b\u003e).\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the output must contain the length of the sequence of operations \u003cb\u003eK\u003c/b\u003e. The following \u003cb\u003eK\u003c/b\u003e lines must each describe one operation. If there are several sequences of minimal length, output any one of them. If the desired result can’t be achieved, the first and only line of the file must contain the word ‘\u003cb\u003eimpossible\u003c/b\u003e’.\u003c/p\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 5 4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e6\r\nFILL(2)\r\nPOUR(2,1)\r\nDROP(1)\r\nPOUR(2,1)\r\nFILL(2)\r\nPOUR(2,1)\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}