#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ld = long double;

#define all(x)  x.begin(),x.end()
#define v(x) vector<x>
#define nl '\n'
#define fxd(x) fixed << setprecision(x)
template<class t> using ordered_set = tree<t, null_type, less<t>, rb_tree_tag, tree_order_statistics_node_update>;
template<class t> using ordered_multiset = tree<t, null_type, less_equal<t>, rb_tree_tag, tree_order_statistics_node_update>;


int main()
{
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    ll n , t; cin >> n >> t;
    //          val,pos
    vector<pair<ll,ll>> arr(n);
    for (int i = 0; i < n; i++)
    {
        cin >> arr[i].first;
        arr[i].second = i+1;
    }
    
    sort(all(arr));
    
    ll l = 0, r = n-1;
    while (l < r)
    {
        if(arr[l].first+arr[r].first == t)
        {
            cout << arr[l].second << " " << arr[r].second;
            return 0;
        }
        else if(arr[l].first+arr[r].first > t)
        {
            r--;
        }
        else
        {
            l++;
        }
    }
    cout << "IMPOSSIBLE";

}