program paprastosios_trupmenos;
  { 63 u‘davinys }

  function dbd (x, y : integer) : integer;
    { randa skai‡i— x ir y did‘iausi…j bendr… dalikl }
  begin
    while (x <> 0) and (y <> 0) do
      if x >= y
         then x := x mod y
         else y := y mod x;
      dbd := x + y
  end;  { dbd }

  procedure spausdinti (n : integer);
    var sk, vard : integer;
  begin
    for vard := 2 to n do
      for sk := 1 to vard - 1 do
        if dbd (sk, vard) = 1
          then write (sk, '/', vard, ' ');
  end;

  var f : text;
      n : integer;
begin
  assign (f, 'trup.dat');
  reset (f);
  readln (f, n);
  close (f);
  spausdinti (n);
end.