Language: C++

#include<bits/stdc++.h>
using namespace std;
using ull=unsigned long long;
#define mod 1000000007
#define mod2 998244353 
#define PI 3.14159265
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define pb push_back
#define vi vector<ll>
#define sz size()
#define setbits(x)  __builtin_popcount(x)
#define fi first
#define se second
#define lz length()
#define all(x) (x).begin(),(x).end()
#define scf(x) scanf("%lld",&x)
#define rep(i,n) for(ll i=0;i<n;i++)
const int INF = (int)1e9;
const ll IINF=1LL<<62;
const int maxn=10000005;

//int divr[maxn];
/**/
/*void divisor()
{for(int i=2;i<sqrt(maxn);i++)
     {
          if(!divr[i])
          {
               for(int j=i*i;j<maxn;j+=i)if(!divr[j])divr[j]=i;     
          }
     }
     for(int i=1;i<maxn;i++)if(!divr[i])divr[i]=i;
}*/
 
/*const int N=1000005;
ll n;
struct line {
    long long m, c;
    long long eval(long long x) { return m * x + c; }
    long double intersectX(line l) { return (long double) (c - l.c) / (l.m - m); }
};
vector<pair<pi,ll>> rect;
deque<line> dq;
*/
/*int find(int a){
     if(a==par[a])return a;
     return par[a]=find(par[a]);
}
void unite(int a,int b){
     a=find(a),b=find(b);
     if(a==b)return ;
     par[b]=a;
}
ll modexpo(ll a,ll b)
{
     int ans=1LL;
     while(b>0)
     {
          if(b&1)ans=(ans*a)%mod;
          a=(a*a)%mod;
          b>>=1;
     }
     return ans;
}
*/





int main(){
     ll n,l;
     cin>>n>>l;
     vector<ll> a(n);
     vector<pi> vec;
     for(int i=0;i<n;i++){
          cin>>a[i];vec.pb({a[i],i+1});
     }
     vector<int> ans;
     sort(vec.begin(),vec.end());
     int idx=0;
     ll tmp=0;
     for(int i=0;i<n;i++){
          tmp+=vec[i].fi;
          if(tmp>=l&&i>=1){
               ans.pb(vec[idx].se);
               tmp-=vec[idx].fi;idx++;
          }
     }
     if(tmp>=l&&ans.size()<n-1){
          ans.pb(vec[idx].se);
     }
     if(ans.size()==n-1){
          cout<<"Possible\n";
          for(auto it:ans)cout<<it<<endl;
     }
     else{
          cout<<"Impossible";
     }

}



































#include<bits/stdc++.h>
using namespace std;
using ull=unsigned long long;
#define mod 1000000007
#define mod2 998244353 
#define PI 3.14159265
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define pb push_back
#define vi vector<ll>
#define sz size()
#define setbits(x)  __builtin_popcount(x)
#define fi first
#define se second
#define lz length()
#define all(x) (x).begin(),(x).end()
#define scf(x) scanf("%lld",&x)
#define rep(i,n) for(ll i=0;i<n;i++)
const int INF = (int)1e9;
const ll IINF=1LL<<62;
const int maxn=10000005;

//int divr[maxn];
/**/
/*void divisor()
{for(int i=2;i<sqrt(maxn);i++)
     {
          if(!divr[i])
          {
               for(int j=i*i;j<maxn;j+=i)if(!divr[j])divr[j]=i;     
          }
     }
     for(int i=1;i<maxn;i++)if(!divr[i])divr[i]=i;
}*/
 
/*const int N=1000005;
ll n;
struct line {
    long long m, c;
    long long eval(long long x) { return m * x + c; }
    long double intersectX(line l) { return (long double) (c - l.c) / (l.m - m); }
};
vector<pair<pi,ll>> rect;
deque<line> dq;
*/
/*int find(int a){
     if(a==par[a])return a;
     return par[a]=find(par[a]);
}
void unite(int a,int b){
     a=find(a),b=find(b);
     if(a==b)return ;
     par[b]=a;
}
ll modexpo(ll a,ll b)
{
     int ans=1LL;
     while(b>0)
     {
          if(b&1)ans=(ans*a)%mod;
          a=(a*a)%mod;
          b>>=1;
     }
     return ans;
}
*/





int main(){
     ll n,l;
     cin>>n>>l;
     vector<ll> a(n);
     vector<pi> vec;
     for(int i=0;i<n;i++){
          cin>>a[i];vec.pb({a[i],i});
     }
     vector<int> ans;
     sort(vec.begin(),vec.end());
     if(vec[n-1].fi+vec[n-2].fi>=l){
          cout<<"Possible\n";
          for(int i=0;i<n-1;i++){
               cout<<vec[i].se<<"\n";
          }
     }
     else{
          cout<<"Impossible";
     }
     

}

























































Compiler output:
a.cc:158:11: error: redefinition of 'const int INF'
  158 | const int INF = (int)1e9;
      |           ^~~
a.cc:20:11: note: 'const int INF' previously defined here
   20 | const int INF = (int)1e9;
      |           ^~~
a.cc:159:10: error: redefinition of 'const long long int IINF'
  159 | const ll IINF=1LL<<62;
      |          ^~~~
a.cc:21:10: note: 'const long long int IINF' previously defined here
   21 | const ll IINF=1LL<<62;
      |          ^~~~
a.cc:160:11: error: redefinition of 'const int maxn'
  160 | const int maxn=10000005;
      |           ^~~~
a.cc:22:11: note: 'const int maxn' previously defined here
   22 | const int maxn=10000005;
      |           ^~~~
a.cc:211:5: error: redefinition of 'int main()'
  211 | int main(){
      |     ^~~~
a.cc:73:5: note: 'int main()' previously defined here
   73 | int main(){
      |     ^~~~