#include <iostream>
#include <string.h>
using namespace std;
char s[257];
int num[257][6], l, ans, flag, end, test;
int f[257][900000];
int fd[257][900000];
void pre()
{
int base = 1, i, j, k;
ans = 0;
flag = 0;
l = strlen(s) - 1;
while(s[l] != '=')
{
ans += (s[l] - '0') * base;
base *= 10;
l --;
}
//printf("ans = %d\n",ans);
memset(num,0,sizeof(num));
for(i= 0; i < l; i ++)
{
int temp = 0;
for(j = 0; j < 5; j ++)
if(i + j < l)
{
temp = temp * 10 + s[i + j] - '0';
num[i][j] = temp;
//printf("%d ",temp);
}
//puts("");
}
}
void out()
{
int pos, sum, ll, tp, ts, a[300];
pos = l;
sum = ans;
ll = -1;
while(pos >= 0)
{
//printf("%d\n",pos);
tp = fd[pos][sum];
ts = pos - 1 - tp;
a[++ll] = num[tp][ts];
ts = sum - num[tp][ts];
pos = tp; sum = ts;
}
printf("%d. %d",++test, a[ll-1]);
for(int i = ll-2; i >= 0; i --)printf("+%d", a[i]);
printf("=%d\n",ans);
}
void dp()
{
int i, j, k;
char temp;
for(i = 0; i <= l; i ++)
for(j = 0; j <= ans; j ++)
f[i][j] = -1;
fd[0][0] = -1;
f[0][0] = 0;
for(i = 0; i <= l; i ++)
{
for(j = 0; j <= ans; j ++)
if(f[i][j] >= 0)
{
for(k = 0; k < 5; k ++)
if(j + num[i][k] <= ans && num[i][k])
{
temp = f[i + k + 1][j + num[i][k]];
if(temp < 0 || temp > f[i][j] + 1)
{
f[i + k + 1][j + num[i][k]] = f[i][j] + 1;
fd[i + k + 1][j + num[i][k]] = i;
}
}
}
}
//for(i=0;i<=l;i++){for(j=0;j<=ans;j++)printf("%d ",f[i][j]);puts("");}
if(f[l][ans] > 0)
{
out();
//printf("%d\n",f[l][ans]);
}
else
{
printf("%d. IMPOSSIBLE\n",++test);
}
}
int main()
{
test = 0;
freopen("in.txt","r",stdin);
while(gets(s) != NULL)
{
if(!strcmp(s, "0=0")) break;
pre();
dp();
}
//puts("s");
while(1);
}