Uses
System.Collections.Generic,
System;
var
simple: List := new List;
i, n, p: integer;
m: longint;
begin
read(n);
for i := 2 to n do
begin
m := 1;
foreach s: integer in simple do
m := m * i mod s;
if m > 0 then begin
simple.Add(i);
// write(i, ' ');
end;
end;
writeln();
foreach s: integer in simple do
begin
if Math.Pow(2, s) - 1 <= longint.MaxValue then begin<br> m := round(Math.Pow(2, s) - 1);
if (m <= n) and simple.Contains(m) then<br> write(m, ' ');
end;
end;
end.