program grazios_lygtys;
  { 81 u‘davinys }
  procedure lygtys (m, n : integer);
    { randa ir iž karto spausdina ekrane gra‘ias lygtis }
    var yra : boolean; { ar yra gra‘i— lyg‡i— }
        x1, x2,   { lyg‡i— žaknys }
        minx, maxx, { lyg‡i— žakn— diapazonas }
        a, b, c, { lyg‡i— koeficientai }
        tarp : integer;
  begin
    yra := false;
    { rasime koeficient… a }
    if (m <= 1) and (n >= 1)
       then a := 1
       else if (m <= -1) and (n >= -1)
               then a := -1
               else if n < 0
                       then a := n
                       else a := m;
    { rasime galimus lyg‡i— žakn— intervalus }
    if abs(n) > abs (m)
       then tarp := abs (n)
       else tarp := abs (m);
    minx := - tarp div abs(a);
    maxx := tarp div abs(a);
    for x1 := minx to maxx do
      if x1 <> 0   { jei nors viena žaknis lygi nuliui, tuomet }
        then       { ir koeficientas c bus lygus nuliui }
          begin
            for x2 := minx to x1 - 1 do
              if x2 <> 0
                 then
                   begin
                     c := a * x1 * x2;
                     b := a * (- x1 - x2);  { lyg‡i— generavimas }
                     if (b <> 0) and (b <= n) and (b >= m) and
                        (c >= m) and (c <= n) { jei koeficientai telpa }
                        then begin            {  duot… interval… }
                               yra := true;
                               writeln (a, ' ', b, ' ', c, ' ', x1, ' ', x2);  { I÷vedimas }
                             end;
                   end;
          end;
    if not yra
       then writeln ('GRA’I§ LYG€I§ NRA');
  end;
  var m, n : integer;
      f : text;
begin
  assign (f, 'lygtys.dat');
  reset (f);
  readln (f, m, n);
  close (f);
  lygtys (m, n)
end.