#include<iostream>
#include<cstdio>
#include<stack>
#include<cstring>
#include<queue>
using namespace std;
const int MAX_OPT = 100;
int opt[MAX_OPT];
char opt_name[][5] = { "ADD", "SUB", "SUL", "DIV", "DUP" }; //记录操作名称
int a, b;
struct node{
string pre; //记录之前的步骤
int op; //记录当前的操作数,分别用0, 1, 2, 3, 4来对应
stack<int> s; //数据栈
} ;
queue<node> q;
node n;
void op() //进行数据操作
{
int a, b;
if(n.op != 4) { //只有"DUP"只需要一个操作数
a = n.s.top(); n.s.pop();
b = n.s.top(); n.s.pop();
} else {
a = n.s.top(); //进行"DUP"操作
}
switch(n.op)
{
case 0: n.s.push(a + b); break; //"ADD"
case 1: n.s.push(b - a); break; //"SUB"
case 2: n.s.push(a * b); break; //"SUL"
case 3: n.s.push(b / a); break; //"DIV"
case 4: n.s.push(a); break; //"DUP"
}
n.pre += (char)(n.op + '0'); //添加当前操作
}
void clear_st_q()
{
while( n.s.size() ){
n.s.pop();
}
while( q.size() ){
q.pop();
}
}
void bfs()
{
//刚开始只能做"DUP"操作
n.op = 4; //"DUP"
n.pre = "";//字符串清空
n.s.push(a); //给栈压入第一个数,即a;
q.push(n); //借助队列的bfs,节点n就是root节点。
while( !q.empty() ){
n = q.front();
q.pop();
op(); //进行操作
int top = n.s.top();
if(top == b) return; //取栈顶元素,用于判断操作"DIV"是否合法
for(int i = 0; i < 5; i++){ //确定下一次的操作数
n.op = i;
switch( i ){
case 0: case 1: case 2: case 3:
if(n.s.size() < 2) break; //当前操作数小于两个, 不能进行操作
if(i == 3 && top == 0) break; //若除数为0,则不能进行"DIV"操作
case 4:
q.push(n); //若操作合法,则把当前节点压入栈中。
}
}
}
}
int main()
{
while( scanf("%d%d", &a, &b) == 2 ){
bfs();
string s = n.pre;
for(size_t i = 0; i < s.size(); i++){
printf("%s\n", opt_name[s[i] - '0']);
}
cout << endl;
clear_st_q();
}
return 0;
}