#include<stdio.h>
#include<math.h>
int CntWeiShu(int a)
{
int cnt; cnt =0;
while(a)
{
a/=10; cnt++;
}
return cnt;
} int Sw(int a)
{
int s;
while(a)
{
s = a%10; a/=10;
} return s;
} void SelectSort(int a[],int n)
{
int i,j,k,tmp,cnt =0;
for(i=0; i<n-1;i++)
{
k =i;
for(j=i+1;j<n;j++)
if(a[j] < a[k])
k =j;
if(k!=i)
{
tmp =a[k];
a[k] = a[i];
a[i] = tmp;
}
}
}
int main()
{
int a,b,tb,i,c,flag,k,tk,m,ta,ti; int s[10000],q[10000],cnt;
scanf("%d",&a);
while(a!=0)
{
flag =0; cnt=0;
for(c=0;c<=9;c++)
{
if( (a - c) % 11 == 0)
{ b = (a - c) / 11;
b = b*10 + c; flag =1;
s[cnt] =b; cnt++;
}
} tk = CntWeiShu(a);
for(k=tk-1;k<=tk;k++)
{
for(c=1;c<=9;c++)
{
if( a % 2 == 0)
{
if(k>=2)
{
b = a + c*(int)(pow(10,k-1));
b = b/2;
}
if(Sw(b)== c && k>=2)
{
flag =1; s[cnt] =b; cnt++;
}
}
}
} for(k= 2; k<tk ; k++)
for(i=0;i<=1;i++)
{
b =( a/(int)(pow(10,k-1)) - i) % 11;
ta = (a/(int)(pow(10,k-1)) - b - i)/11;
if( a % 2 ==0)
{
c = (a - (int)(pow(10,k-1)) * (11*ta+b)) / 2;
tb = (10*ta+ b)*(int)(pow(10,k-1)) + c; flag =1;
s[cnt] =tb; cnt++;
}
} if(flag ==0) printf("No solution.");
else
{
SelectSort(s,cnt); ti=0;
for(i=0;i<cnt;i++)
{
while(s[i]==s[i+1] && i+1<cnt)
i++;
q[ti] = s[i]; ti++;
} for(i=0; i<ti;i++)
printf("%d ",q[i]);
}
printf("\n");
scanf("%d",&a);
}
return 0;
}
#include<math.h>
int CntWeiShu(int a)
{
int cnt; cnt =0;
while(a)
{
a/=10; cnt++;
}
return cnt;
} int Sw(int a)
{
int s;
while(a)
{
s = a%10; a/=10;
} return s;
} void SelectSort(int a[],int n)
{
int i,j,k,tmp,cnt =0;
for(i=0; i<n-1;i++)
{
k =i;
for(j=i+1;j<n;j++)
if(a[j] < a[k])
k =j;
if(k!=i)
{
tmp =a[k];
a[k] = a[i];
a[i] = tmp;
}
}
}
int main()
{
int a,b,tb,i,c,flag,k,tk,m,ta,ti; int s[10000],q[10000],cnt;
scanf("%d",&a);
while(a!=0)
{
flag =0; cnt=0;
for(c=0;c<=9;c++)
{
if( (a - c) % 11 == 0)
{ b = (a - c) / 11;
b = b*10 + c; flag =1;
s[cnt] =b; cnt++;
}
} tk = CntWeiShu(a);
for(k=tk-1;k<=tk;k++)
{
for(c=1;c<=9;c++)
{
if( a % 2 == 0)
{
if(k>=2)
{
b = a + c*(int)(pow(10,k-1));
b = b/2;
}
if(Sw(b)== c && k>=2)
{
flag =1; s[cnt] =b; cnt++;
}
}
}
} for(k= 2; k<tk ; k++)
for(i=0;i<=1;i++)
{
b =( a/(int)(pow(10,k-1)) - i) % 11;
ta = (a/(int)(pow(10,k-1)) - b - i)/11;
if( a % 2 ==0)
{
c = (a - (int)(pow(10,k-1)) * (11*ta+b)) / 2;
tb = (10*ta+ b)*(int)(pow(10,k-1)) + c; flag =1;
s[cnt] =tb; cnt++;
}
} if(flag ==0) printf("No solution.");
else
{
SelectSort(s,cnt); ti=0;
for(i=0;i<cnt;i++)
{
while(s[i]==s[i+1] && i+1<cnt)
i++;
q[ti] = s[i]; ti++;
} for(i=0; i<ti;i++)
printf("%d ",q[i]);
}
printf("\n");
scanf("%d",&a);
}
return 0;
}