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