#include<bits/stdc++.h>
using namespace std;
bool QAQ(int a,int b,int c,int d)
{
if(d!=a&&d!=b&&d!=c)
{
return true;
}
return false;
}
int main(){
for(int i=123;i<=329;i++)
{
int l=2i;
int m=3i;
int a=i%10,b=i/10%10,c=i/100%10;
if(a!=b&&a!=c&&b!=c&&a!=0&&b!=0&&c!=0&&a!=5)
{
int d=l%10,e=l/10%10,f=l/100%10;
if(d!=e&&d!=f&&e!=f&&QAQ(a,b,c,d)&&QAQ(a,b,c,e)&&QAQ(a,b,c,f))
{
int g=m%10,h=m/10%10,j=m/100%10;
if(g!=h&&g!=j&&h!=j&&QAQ(a,b,c,g)&&QAQ(a,b,c,h)&&QAQ(a,b,c,j)&&QAQ(d,e,f,g)&&QAQ(d,e,f,h)&&QAQ(d,e,f,j)&&h!=0)
{
cout<<i<<" "<<l<<" "<<m<<endl;
}
}
}
}
return 0;
}