#include<iostream>
using std::cin;
using std::cout;
using std::endl;
int a[100000][100000];
int main(){
freopen("1.in", "r", stdin);
int n, m;
scanf("%d%d", &n, &m);
int *begin = new int[n];
int *end = new int[n];
int i, j,min = 32767,value,pt = 0;
for (i = 0; i < n; i++){
scanf("%d", &value);
a[i][i] = value;
for (j = 0; j <=i; j++){
if (i!=j&&i)
a[j][i] = value + a[j][i - 1];
if (a[j][i] >=m&&a[j][i] - m < min){
min = a[j][i] - m;
begin[0] = j;
end[0] = i;
pt = 1;
}
else if (a[j][i]>=m && a[j][i] - m == min){
begin[pt] = j;
end[pt] = i;
pt++;
}
}
}
for (i = 0; i < pt; i++)
printf("%d-%d\n", begin[i] + 1, end[i] + 1);
return 0;
}
#include<iostream>
using std::cin;
using std::cout;
using std::endl;
int main(){
freopen("1.in", "r", stdin);
int n, m;
scanf("%d%d", &n, &m);
int *a= new int[n];
int *begin = new int[n];
int *end = new int[n];
int pt = 0;
int i, j,min = 37267;
for (i = 0; i < n; i++)
scanf("%d", &a[i]);
int sum = 0;
for (i = 0; i < n; i++){
sum = 0;
for (j = i; j < n; j++)
{
sum += a[j];
if (sum == m){
printf("%d-%d\n", i + 1, j + 1);
min = 0;
break;
}
else if (sum - m>0 && sum - m < min){
begin[0] = i;
end[0] = j;
min = sum - m;
pt = 1;
}
else if (sum - m>0 && sum - m == min){
begin[pt] = i;
end[pt] = j;
pt++;
}
}
}
if (min){
for (i = 0; i < pt; i++)
printf("%d-%d\n", begin[i] + 1, end[i] + 1);
}
return 0;
}