level 2
var i:longint;
s:string;
begin
for i:=1000 to 9999 do
begin
str(i,s);
if (s[2]<>'3') or (s[3]<>'6') then continue;
if i mod 6<>0 then continue;
writeln(i);
break;
end;
for i:=9999 downto 1 do
begin
str(i,s);
if (s[2]<>'3') or (s[3]<>'6') then continue;
if i mod 6<>0 then continue;
writeln(i);
break;
end;
end.
MIN=1362
MAX=9366
2014年05月09日 14点05分