/*   @JUDGE_ID:   1705PZ   571   C */
#include <stdio.h>

#define FILLA 0
#define FILLB 1
#define EMPTYA 2
#define EMPTYB 3
#define POURAB 4
#define POURBA 5

int table[1000][4];
int top;

int small(int x,int y){
	if(x <= y)
		return x;
	else
		return y;
	}

void fill(int *now,int capacity){
	*now = capacity;
	}

void empty(int *now){
	*now = 0;
	}

void pour(int *a,int *b,int bcapacity){
	int temp;
	temp = small(*a,bcapacity - *b);
	*a -= temp;
	*b += temp;
	}

void push(int a,int b,int comefrom,int mode){
	table[top][0] = a;
	table[top][1] = b;
	table[top][2] = comefrom;
	table[top][3] = mode;
	top++;
	}

int check(int a,int b){
	int i;
	for(i = 0;i < top;i++)
		if(table[i][0] == a && table[i][1] == b)
			return 1;
	return 0;
	}

int main(){
int a,b,c,now,tempa,tempb,temp,count,i;
int answer[100];
char *action[]= {"fill A","fill B","empty A","empty B","pour A B","pour B A","success"};
while(scanf("%d %d %d",&a,&b,&c) == 3){
	top = 1;
	now = 0;
	table[0][0] = 0;
	table[0][1] = 0;
	table[0][2] = -1;
	table[0][3] = -1;
	while(1){
		tempa = table[now][0];
		tempb = table[now][1];
		fill(&tempa,a);
		if(check(tempa,tempb) == 0)
			push(tempa,tempb,now,FILLA);
		if(tempb == c)
			break;
		tempa = table[now][0];
		tempb = table[now][1];
		fill(&tempb,b);
		if(check(tempa,tempb) == 0)
			push(tempa,tempb,now,FILLB);
		if(tempb == c)
			break;
		tempa = table[now][0];
		tempb = table[now][1];
		empty(&tempa);
		if(check(tempa,tempb) == 0)
			push(tempa,tempb,now,EMPTYA);
		if(tempb == c)
			break;
		tempa = table[now][0];
		tempb = table[now][1];
		empty(&tempb);
		if(check(tempa,tempb) == 0)
			push(tempa,tempb,now,EMPTYB);
		if(tempb == c)
			break;
		tempa = table[now][0];
		tempb = table[now][1];
		pour(&tempa,&tempb,b);
		if(check(tempa,tempb) == 0)
			push(tempa,tempb,now,POURAB);
		if(tempb == c)
			break;
		tempa = table[now][0];
		tempb = table[now][1];
		pour(&tempb,&tempa,a);
		if(check(tempa,tempb) == 0)
			push(tempa,tempb,now,POURBA);
		if(tempb == c)
			break;
		now++;
		}
	count = 0;
	temp = top - 1;
	while(temp != -1){
		answer[count++] = temp;
		temp = table[temp][2];
		}
	for(i = count - 2;i >= 0;i--)
		printf("%s\n",action[table[answer[i]][3]]);
	printf("%s\n",action[6]);
	}
return 0;
}
@END_OF_SOURCE_CODE
