#include<iostream>
#define N 10
int a[N]= {0},b[N]= {0},c[N]= {0};
using namespace std;
int main()
{
for(int i=123; i<333; i++)
{
a[1]=i%100%10;
a[2]=i%100/10;
a[3]=i/100;
b[1]=2*i%10%10;
b[2]=2*i%100/10;
b[3]=2*i/100;
c[1]=3*i%10%10;
c[2]=3*i%100/10;
c[3]=3*i/100;
if(a[1]*a[2]*a[3]*b[1]*b[2]*b[3]*c[1]*c[2]*c[3]==362880&&a[1]+a[2]+a[3]+b[1]+b[2]+b[3]+c[1]+c[2]+c[3]==45)
{
cout<<i<<" "<<i*2<<" "<<i*3<<endl;
}
}
return 0;
}