#include <iostream>
#include <vector>
#include <algorithm>
int min_level = 0x00FFFFFF;
struct btree
{
btree* parent;
btree* right;
btree* left;
int rl;
int level;
int value;
};
btree* start_node;
std::vector<btree*> solutions;
std::vector<unsigned char> reversed_steps;
void build_steps(btree* node,int req)
{
if(node->value == req)
{
solutions.push_back(node);
min_level = node->level;
return;
}
if(node->value > req || node->level >= min_level)
return;
node->right = new btree;
node->left = new btree;
node->right->value = node->value * 2;
node->right->rl = 1;
node->left->rl = 0;
node->left->value = node->value + 3;
node->right->level = node->left->level = node->level + 1;
node->right->parent = node->left->parent = node;
build_steps(node->right,req);
build_steps(node->left,req);
}
int main()
{
int n;
std::cin >> n;
/*if(n % 3 == 0)
{
std::cout << '0';
return 0;
}*/
start_node = new btree;
start_node->value = 1;
start_node->level = 0;
build_steps(start_node,n);
btree* quickest = (btree*)NULL;
int quickest_steps = 0x00FFFFFFF;
for(int i = 0;i < solutions.size();i++)
{
if(solutions[i]->level < quickest_steps)
{
quickest = solutions[i];
quickest_steps = solutions[i]->level;
}
}
if(quickest != NULL)
reversed_steps.push_back(2);
btree* next = quickest;
while(next != start_node && next != NULL)
{
if(next->rl == 1)
reversed_steps.push_back(1);
else
reversed_steps.push_back(0);
next = next->parent;
}
if(solutions.size() != 0)
std::cout << reversed_steps + 1 << '\n';
for(int i = reversed_steps.size()-1;i >= 0;i--)
{
if(reversed_steps[i] == 0)
std::cout << "ADD\n";
else if(reversed_steps[i] == 1)
std::cout << "MUL\n";
else
std::cout << "END\n";
}
if(solutions.size() == 0)
std::cout << '0';
return 0;
}