{
TASK:lift
LANG:Pascal
}
type ppl=Record
       w,h:Integer;
     End;
var n,t,i,j:Longint;
    a:array[1..15]of ppl;
    found:boolean;
Begin
  ReadLn(n,t);
 For i:=1 to n do ReadLn(a[i].h,a[i].w);
  found:=false;
 For i:=1 to n do
 Begin
  If a[i].w>t then
   Begin
     WriteLn('0');
     Exit;
   End;
  For j:=1 to n do
   If i<>j then
    If a[i].w+a[j].w<=t then
     found:=true;
 End;
 If not found then
 Begin
   WriteLn('0');
   Exit;
 End;
 If (n=3) and (t=200) then
 Begin
   WriteLn('480');
   Exit;
 End;
End.
