#include <iostream>
#include <queue>
#include <map>
using namespace std;
typedef pair<int, int> PII;
string st[] = {"FILL(1)","FILL(2)","DROP(1)","DROP(2)","POUR(1,2)","POUR(2,1)"};
struct Node
{
int a, b, step;
string s;
};
int a, b, c;
void bfs()
{
queue<Node> q;
map<PII, int> h;
q.push({0, 0, 0, ""});
h[{0, 0}] = 1;
while (!q.empty())
{
auto t = q.front(); q.pop();
if (t.a == c || t.b == c)
{
cout << t.step << endl;
for (int i = 0; i < t.s.size(); ++i)
cout << st[t.s[i] - '1'] << endl;
return;
}
if (h[{a, t.b}] != 1)
h[{a, t.b}] = 1, q.push({a, t.b, t.step + 1, t.s + "1"});
if (h[{t.a, b}] != 1)
h[{t.a, b}] = 1, q.push({t.a, b, t.step + 1, t.s + "2"});
if (h[{0, t.b}] != 1)
h[{0, t.b}] = 1, q.push({0, t.b, t.step + 1, t.s + "3"});
if (h[{t.a, 0}] != 1)
h[{t.a, 0}] = 1, q.push({t.a, 0, t.step + 1, t.s + "4"});
if (t.a >= b - t.b && h[{t.a - (b - t.b), b}] != 1) //a能把b装满
h[{t.a - (b - t.b), b}] = 1, q.push({t.a - (b - t.b), b, t.step + 1, t.s + "5"});
else if (t.a < b - t.b && h[{0, t.b + t.a}] != 1) //把a倒完也装不满
h[{0, t.b + t.a}] = 1, q.push({0, t.b + t.a, t.step + 1, t.s + "5"});
if (t.b >= a - t.a && h[{a, t.b - (a - t.a)}] != 1) //b能把a装满
h[{a, t.b - (a - t.a)}] = 1, q.push({a, t.b - (a - t.a), t.step + 1, t.s + "6"});
else if (t.b < a - t.a && h[{a + t.b, 0}] != 1) //把b倒完也装不满
h[{t.a + t.b, 0}] = 1, q.push({t.a + t.b, 0, t.step + 1, t.s + "6"});
}
puts("impossible");
}
int main()
{
cin >> a >> b >> c;
bfs();
return 0;
}