{
TASK: SKYLE
LANG: PASCAL
}
program skyle;
type koordinates = array [1..150] of record
                                       x, y : integer;
                                     end;
 var i, virs_sk, ilgis, plotis,
       x1, y1, x2, y2: integer;
       koord: koordinates;
       duom, rez: text;

procedure staciakampis (koord: koordinates; {daugiakampio virðûniø koordinates}
                        virs_sk: integer;   {daugiakampio virðûniø skaièius}
                        var x1, y1,  {virðutinio kairiojo kampo koordinates}
                            x2, y2: integer);  {apatinio deðiniojo kampo koordinates}
  var i : integer;
begin
  x1 := koord[1].x; y1 := koord[1].y;
  x2 := koord[1].x; y2 := koord[1].y;
  for i := 2 to virs_sk do
    begin
      if x1 >= koord[i].x then x1 := koord[i].x;
      if y1 <= koord[i].y then y1 := koord[i].y;
      if x2 <= koord[i].x then x2 := koord[i].x;
      if y2 >= koord[i].y then y2 := koord[i].y;

    end;
 end;

procedure uzdengti (koord: koordinates;
                    ilgis, plotis,  {duoto staèiakampio ilgis ir plotis}
                    x1, y1, x2, y2: integer);
begin
   if (x2 <= x1 + ilgis) and (y2 >= y1 - plotis)
     then begin
             writeln(rez, 'PAVYKS');
             writeln(rez, '1');
             writeln(rez, x1, ' ',y1,' ', x1 + ilgis,' ', y1 - plotis)
          end
      else if (x2 <= x1 + plotis) and (y2 >= y1 - ilgis)
             then begin
                    writeln(rez, 'PAVYKS');
                    writeln(rez, '1');
                    writeln(rez, x1,' ', y1,' ', x1 + plotis,' ', y1 - ilgis)
                  end
              {po du variantus}
              else if (x2 <= x1 + plotis) and (y2 >= y1 - 2 * ilgis)
                     then begin
                            writeln(rez, 'PAVYKS');
                            writeln(rez, '2');
                            writeln(rez, x1,' ', y1,' ', x1 + plotis,' ', y1 - ilgis);
                            writeln(rez, x1,' ', y1 - ilgis,' ', x1 + plotis,' ', y1 - 2 * ilgis)
                          end
                      else if (x2 <= x1 + 2 * plotis) and (y2 >= y1 - ilgis)
                            then begin
                                   writeln(rez, 'PAVYKS');
                                   writeln(rez, '2');
                                   writeln(rez, x1,' ', y1,' ', x1 + plotis,' ', y1 - ilgis);
                                   writeln(rez, x1 + plotis,' ', y1,' ', x1 + 2 * plotis,' ', y1 - ilgis)
                                 end
                             else if (x2 <= x1 + ilgis) and (y2 >= y1 - 2 * plotis)
                                    then begin
                                           writeln(rez, 'PAVYKS');
                                           writeln(rez, '2');
                                           writeln(rez, x1,' ', y1,' ', x1 + ilgis,' ', y1 - plotis);
                                           writeln(rez, x1,' ', y1 - plotis,' ', x1 + ilgis,' ', y1 - 2 * plotis)
                                         end
                                   else if (x2 <= x1 + 2 * ilgis) and (y2 >= y1 - plotis)
                                          then begin
                                                 writeln(rez, 'PAVYKS');
                                                 writeln(rez, '2');
                                                 writeln(rez, x1, ' ',y1,' ', x1 + ilgis,' ', y1 - plotis);
                                                 writeln(rez, x1 + ilgis,' ', y1,' ', x1 + 2 * ilgis,' ', y1 - plotis)
                                               end
                                           else writeln(rez,'NEPAVYKS')
end;

begin
  assign(duom, 'SKYLE.DAT');
  reset(duom);
  assign(rez, 'SKYLE.REZ');
  rewrite(rez);
  readln(duom, ilgis, plotis);
  readln(duom, virs_sk);
  for i := 1 to virs_sk do
    readln (duom, koord[i].x, koord[i].y);
  staciakampis (koord, virs_sk, x1, y1, x2, y2);
  uzdengti (koord, ilgis, plotis, x1, y1, x2, y2);
  close(duom);
  close(rez);
end.
