#include<bits/stdc++.h> using namespace std; int a[4000005]; queueb; int main(){ int n,m; cin>>n>>m; for(int i=1;i<=n;i++)cin>>a[i]; long long s=0,ma=0,l=1,r=1,ml,mr; for(int i=1;i<=n;i++){ if(s+a[i]>m){ while(s+a[i]>m){ s-=b.front(); l++; b.pop(); } } b.push(a[i]); s+=a[i]; r++; if(ma<s){ ma=s; ml=l; mr=r-1; } } cout<<ml<<' '<<mr<<' '<<ma<<endl; }