#include <stdio.h>
int main()//n=0 e=5
{
int f,o,r,t,y,s,i,x;
int e=5,n=0;
for(f=1; f<=9; f++)
{
for(o=1; o<=9; o++)
{
if(f==o||f==5||o==5) continue;
for(r=1; r<=9; r++)
{
if(f==r || o==r||r==5) continue;
for(t=1; t<=9; t++)
{
if(t==f||t==o||t==r||t==r)continue;
for(y=1; y<=9; y++)
{
if(y==f||y==o||y==r||y==t||y==5)continue;
for(s=1; s<=9; s++)
{
if(s==f||s==o||s==r||s==t||s==y||s==5)continue; //s와 위의 문자들이랑 같은지?
for(i=1; i<=9; i++)
{
if(i==f||i==s||i==o|i==r||i==t||i==y||i==5)continue;
for(x=1; x<=9; x++)
{
if(x==s||x==i||x==f||x==o||x==r||x==t||x==y||x==5)continue;
int z = (r+t*2+1);
// f o r t y s i x 가 모두 다르다!!
if(z%10==x
&&(o+z/10)%10==i
&&f+(o+z)/10==s
&&f<s
)
{
printf("%d%d%d%d%d+%d%d%d+%d%d%d=",f,o,r,t,y,t,e,n,t,e,n);
printf("%d%d%d%d%d\n",s,i,x,t,y);
}
}
}
}
}
}
}
}
}
return 0;
}