#include <bits/stdc++.h>
#define sz(in) in.size()
#define mp make_pair
#define pb push_back
using namespace std;
int solve(vector<int> in , int k)//
{
assert( sz(in) >=2 );
stack<int> st;
st.push( 0 );
for(int i=1;i<sz(in);i++)
{
int curr=in[i];
while ( (!st.empty()) &&( in[st.top()] > curr) )
{
if( ( in[st.top()] + curr) >= k)
{
cout<<st.top()<<" "<<i<<endl;
}
st.pop();
}
if( !st.empty())
{
if( ( in[st.top()] + curr) >= k)
{
cout<<st.top()<<" "<<i<<endl;
}
}
st.push(i);
}
return 0;
}
int main()
{
int n,k;
cin>>n>>k;
vector<int> in(n);
for(int i=0;i<n;i++)
cin>>in[i];
solve(in,k);
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgc3ooaW4pIGluLnNpemUoKQojZGVmaW5lIG1wIG1ha2VfcGFpcgojZGVmaW5lIHBiIHB1c2hfYmFjawp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IHNvbHZlKHZlY3RvcjxpbnQ+IGluICwgaW50IGspLy8KewogICBhc3NlcnQoIHN6KGluKSA+PTIgKTsKCiAgIHN0YWNrPGludD4gc3Q7CgogICBzdC5wdXNoKCAwICk7CgogICBmb3IoaW50IGk9MTtpPHN6KGluKTtpKyspCiAgIHsKICAgICAgIGludCBjdXJyPWluW2ldOwoKICAgICAgIHdoaWxlICggKCFzdC5lbXB0eSgpKSAmJiggaW5bc3QudG9wKCldID4gY3VycikgKQogICAgICAgewogICAgICAgICBpZiggKCBpbltzdC50b3AoKV0gKyBjdXJyKSA+PSBrKQogICAgICAgICB7CiAgICAgICAgICAgICBjb3V0PDxzdC50b3AoKTw8IiAgIjw8aTw8ZW5kbDsKICAgICAgICAgfQoKICAgICAgICAgc3QucG9wKCk7CiAgICAgICB9CgogICAgICAgaWYoICFzdC5lbXB0eSgpKQogICAgICAgewogICAgICAgICAgICAgaWYoICggaW5bc3QudG9wKCldICsgY3VycikgPj0gaykKICAgICAgICAgICAgIHsKICAgICAgICAgICAgICBjb3V0PDxzdC50b3AoKTw8IiAgIjw8aTw8ZW5kbDsKICAgICAgICAgICAgIH0KICAgICAgIH0KCiAgICAgICBzdC5wdXNoKGkpOwogICB9CgogICByZXR1cm4gMDsKCn0KCgppbnQgbWFpbigpCnsKCiAgICAgICAgIGludCBuLGs7CgogICAgICAgIGNpbj4+bj4+azsKCiAgICAgICAgdmVjdG9yPGludD4gaW4obik7CgogICAgICAgIGZvcihpbnQgaT0wO2k8bjtpKyspCiAgICAgICAgICAgICBjaW4+PmluW2ldOwoKICAgICAgICBzb2x2ZShpbixrKTsKCn0=