const
  MAX = 541;

var
  np: array[2..MAX] of boolean;
  i, j: longint;

begin
  for i := 2 to MAX do
  begin
    if not np[i] then
    begin
      writeln(i);
      j := 2 * i;
      while (j <= MAX) do
      begin
        np[j] := true;
        inc(j, i);
      end;
    end;
  end;
end.