var a:array[0..9] of integer;
f:boolean;
i,ii,iii,j,x:integer;
begin
for i:=111 to 333 do
begin
fillchar(a,sizeof(a),0);
ii:=i*2;
iii:=i*3;
f:=true;
x:=i;
while x<>0 do
begin
inc(a[x mod 10]);
x:=x div 10;
end;
x:=ii;
while x<>0 do
begin
inc(a[x mod 10]);
x:=x div 10;
end;
x:=iii;
while x<>0 do
begin
inc(a[x mod 10]);
x:=x div 10;
end;
for j:=1 to 9 do
if a[j]<>1 then f:=false;
if f then writeln(i,' ',ii,' ',iii,' ');
end;
end.