program b1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  a,b: array [1..1000] of integer;
  atruth, btruth: array [1..1000] of boolean;
  n,i,j: integer;
  fin,fout: text;
  x:integer;
begin
  assign (fin,'joke.in');  reset(fin);
  assign (fout,'joke.out'); rewrite(fout);
  readln(fin,n);
  for i:=1 to n do
   begin
   readln(fin,a[i],b[i]);
   end;
  for i:=1 to n do
   begin
     x:=0;
     for j:=n downto i do
     begin
     x:=x+a[j];
     end;
     if a[i]<x then begin atruth[i]:=true; end;
   end;
 for i:=1 to n do
   begin
     x:=0;
     for j:=i+1 to n do
      begin
       x:=x+b[j];
      end;
     if b[i]>=x then begin btruth[i]:=true; end;
   end;
 x:=0;
 for i:=1 to n do
  begin
  if (atruth[i]=false) or (btruth[i]=false)then
   begin
   x:=x+1; a[x]:=i;
   end;
  end;
  write(fout,x,' ');
  repeat
     i:=i+1;
     write(fout,a[x],' ');
  until (i>=x);
  close(fin);close(fout);
end.

