#include <bits/stdc++.h>
using namespace std;
int n,m,r,t,k;
int mp[100][100];
int arr[300];
int vis[300][300];
int sx,sy,ex,ey;
int dir[8][2] = {
{2, 1},
{2,-1},
{-2, 1},
{-2, -1},
{1,2},
{1,-2},
{-1,2},
{-1,-2}
};
struct Pair {
int first,second;
};
struct Node {
int x,y;
string dis;
int cnt;
};
int main() {
cin >> n >> m >> k;
queue<Node> q;
vector<Pair> p = vector<Pair>();
q.push({0,0,"",0});
while(!q.empty()) {
Node cur = q.front();
q.pop();
if (cur.x == k || cur.y == k) {
cout << cur.cnt << endl;
cout << cur.dis << endl;
return 0;
}
if (vis[cur.x][cur.y])continue;
vis[cur.x][cur.y] = 1;
q.push({n,cur.y,cur.dis + "FILL(1)\n",cur.cnt +1});
q.push({cur.x,m,cur.dis + "FILL(2)\n",cur.cnt +1});
q.push({cur.x,0,cur.dis + "DROP(2)\n",cur.cnt +1});
q.push({0,cur.y,cur.dis + "DROP(1)\n",cur.cnt +1});
int num;
if (cur.x + cur.y <= m) {
num = cur.x;
} else num = m - cur.y;
q.push({cur.x - num,cur.y + num,cur.dis + "POUR(1,2)\n",cur.cnt +1});
if (cur.x + cur.y <= n) {
num = cur.y;
} else num = n - cur.x;
q.push({cur.x + num,cur.y - num, cur.dis + "POUR(2,1)\n",cur.cnt +1});
}
cout << "impossible" << endl;
return 0;
}