var a,b:array[0..1000] of integer;
    n:integer;
Procedure Sort(L,H:integer);
Var i,j,k,t1,t2:integer;
Begin
  If L>=H then exit;
  i:=L;
  j:=H;
  k:=a[(L+H) div 2];
  Repeat
  While a[i]<k do inc(i);
  While a[j]>k do dec(j);
  IF i<=j then
    Begin
       If i<j then
          Begin
            t1:=a[i];    t2:=b[i];
            a[i]:=a[j];  b[i]:=b[j];
            a[j]:=t1;    b[j]:=t2;
          End;
       inc(i);
       dec(j);
    End;
  Until i>j;
    Sort(L,j);
    Sort(i,H);
End;
Procedure Enter;
Var ad,bd,i:integer; //Chinh la 2 diem a,b trong de bai
Begin
Readln(N,ad,bd);
For i:=1 to n do Readln(a[i],b[i]);
Sort(1,n); //Sap xep tang dan theo ai
b[0]:=ad; a[n+1]:=bd; // Khoi tao.
End;
Procedure Process;
Var i,dem:integer;
Begin
dem:=0;
For i:=1 to n+1 do
Begin
If b[i-1]<a[i] then
begin
inc(dem);
Writeln('(',b[i-1],';',a[i],')');
End;
If b[i]<b[i-1] then b[i]:=b[i-1]; //Cap nhat diem cuoi lon nhat hien tai
End;
If dem=0 then Write('Khong co diem nao thoa man')
Else Write('Co ',dem, ' khoang thoa man');
End;
BEGIN
Enter;
Process;
END.