const
inf = 32767;
var
a, min : integer;
begin
min := inf;
while not eoln do
read (a);
if (a < min) and (a mod 3 = 0) then min := a;
end;
if min < inf then writeln (min)
else writeln ('Нет чисел, кратных 3-ем');
end.
const
inf = 32767;
var
a, min : integer;
begin
min := inf;
while not eoln do
begin
read (a);
if (a < min) and (a mod 3 = 0) then min := a;
end;
if min < inf then writeln (min)
else writeln ('Нет чисел, кратных 3-ем');
end.