n,k=map(int,input().split()) a=sorted(map(int,input().split())) i=0 while k>a[i]:k-=a[i];i+=1 print(*[(i,k),(i+1,0)][k==a[i]])