stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main() {

    ios::sync_with_stdio(false);

    cin.tie(NULL);



    int n, t=0;

    pair<int,int> v[200001];

    cin >> n;



    for (int i=1; i<=n; i++) {

        cin >> v[i].second >> v[i].first;

    }



    sort(v+1, v+1+n);



    bool ok = true;

    for (int i=1; i<=n; i++) {

        if (t+v[i].second > v[i].first) {

            ok = false;

            break;

        } else t += v[i].second;

    }



    if (ok) cout << "Yes" << endl;

    else cout << "No" << endl;

}


// Faster C++ solution for the same problem (measured speedup: 2.5746345286905217x):
#include <bits/stdc++.h>



using namespace std ;



const int MAX = 2e5 + 10 ;



int arr[MAX] ;

int n ;



int main()

{

	ios_base::sync_with_stdio(0) ;

	cin.tie(0) ;

	cin>>n ;

	vector< pair<int , int> >vp ;

	for(int i = 0 ; i < n ; ++i)

	{

		int a , b ;

		cin>>a>>b ;

		vp.emplace_back(b , a) ;

	}

	sort(vp.begin() , vp.end()) ;

	int cnt = 0 ;

	for(auto &i : vp)

	{

		int a = i.second , b = i.first ;

		if(cnt > b)

			return cout<<"No\n" , 0 ;

		cnt += a ;

		if(cnt > b)

			return cout<<"No\n" , 0 ;

	}

	return cout<<"Yes\n" , 0 ;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

#define _69e27 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

const int N = 2e5+5, M=2e4+5, oo=0x3f3f3f3f;



ll n, t;

pair<ll, ll> p[N];



int main()

{

    cin >> n;

    for(int i=0; i<n; i++)

        cin >> p[i].second >> p[i].first;

    sort(p, p+n);

    for(int i=0; i<n; i++)

    {

        if(t + p[i].second > p[i].first)

            return cout << "No", 0;

        t+=p[i].second;

    }

    cout << "Yes";

    return 0 ;

}


// Faster C++ solution for the same problem (measured speedup: 5.22097991212193x):
#include<stdio.h>

#include<algorithm>

using namespace std;

struct work{

	long long u;

	long long l;

}a[200005];

bool cmp(work a,work b)

{

	return a.l<b.l;

}

int main()

{

	long long n,i,d,j;

	while(~scanf("%lld",&n))

	{int w=0;

	 long long sum=0;

	 for(i=0;i<n;i++)

	 {scanf("%lld%lld",&a[i].u,&a[i].l);

	 }

	 sort(a,a+n,cmp);

	 for(i=0;i<n;i++)

	 {sum+=a[i].u;

	  if(sum>a[i].l){w=1;break;}

	 }

	if(w==1)printf("No\n");

	else printf("Yes\n");

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;





void Egriiiiiiiii()

{

    ios::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

}



int main()

{

     Egriiiiiiiii() ;



     int n ;

     cin>>n;

     vector<pair<int,int> >v(n);

     int a,b;

     for(int i=0 ;i<n ;i++){

       cin>>a>>b;

       v[i].second=a;

       v[i].first=b ;

     }

     sort(v.begin(),v.end()) ;

     ll arr[n]={0} ; arr[0]=v[0].second ;

     for(int i=1 ;i<n ;i++){

        arr[i]=arr[i-1]+v[i].second ;

     }

     for(int i=0 ;i<n ;i++){

        a=v[i].first ;

        if(a<arr[i]){

            cout<<"No"<<"\n" ;

            return 0;

        }

     }

     cout<<"Yes\n" ;

     return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.283803091742735x):
#include<stdio.h>

#include<algorithm>

using namespace std;

struct work{

	long long u;

	long long l;

}a[200005];

bool cmp(work a,work b)

{

	return a.l<b.l;

}

int main()

{

	long long n,i,d,j;

	while(~scanf("%lld",&n))

	{int w=0;

	 long long sum=0;

	 for(i=0;i<n;i++)

	 {scanf("%lld%lld",&a[i].u,&a[i].l);

	 }

	 sort(a,a+n,cmp);

	 for(i=0;i<n;i++)

	 {sum+=a[i].u;

	  if(sum>a[i].l){w=1;break;}

	 }

	if(w==1)printf("No\n");

	else printf("Yes\n");

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define debug1 cout<<"?"<<endl;

#define debug2 cout<<"?"<<i<<endl;

#define PII pair<int,int>

typedef long long ll;

const int maxn=2e5+9;

const double pi=acos(-1);

const int mod=1e9+7;

const int INF=1e9;

const double ep=1e-7;

using namespace std;

ll kpow(ll a,ll b)

{

	ll ans=1;

	while(b)

	{

		if(b&1)ans=(ans*a)%mod;

		a=(a*a)%mod;

		b>>=1;

	}

	return ans;

}

int main()

{

	ll n,i,a[maxn]={0},ans=0;

	scanf("%lld",&n);

	for(i=1;i<=n;i++)scanf("%lld",&a[i]);

	sort(a+1,a+1+n);

	for(ll i=1;i<=n;i++)ans=(ans+(((a[i]*kpow(2,n-1))%mod*kpow(2,i-1))%mod*(n-i+2))%mod*kpow(2,n-i))%mod;

	printf("%lld\n",ans);

}

// Faster C++ solution for the same problem (measured speedup: 2.546377481170431x):
#include<bits/stdc++.h>

typedef long long ll;

const int maxn=2e5+9;

const int mod=1e9+7;

using namespace std;

ll kpow(ll a,ll b)

{

	ll ans=1;

	while(b)

	{

		if(b&1)ans=(ans*a)%mod;

		a=(a*a)%mod;

		b>>=1;

	}

	return ans;

}

int main()

{

	ll n,i,a[maxn],ans=0;

	scanf("%lld",&n);

	for(i=1;i<=n;i++)scanf("%lld",&a[i]);

	sort(a+1,a+1+n);

	for(ll i=1;i<=n;i++)ans=(ans+(((a[i]*kpow(2,n-1))%mod*kpow(2,i-1))%mod*(n-i+2))%mod*kpow(2,n-i))%mod;

	printf("%lld\n",ans);

}
// Slower C++ solution:
#include "bits/stdc++.h"

using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

const int INF = 1e9;

const ll LINF = 1e18;



/*

 <url:https://agc002.contest.atcoder.jp/tasks/agc002_c>

問題文============================================================

 N 本のロープがあります。 ロープは 1 から N まで番号が振られています。 ロープ i の長さは ai です。

 

 最初、1≤i≤N−1 について、ロープ i の右端とロープ i+1 の左端が結ばれています。

 高橋君は次の操作を N−1 回行い、すべての結び目をほどこうとしています。

 

 ひと繋がりのロープのうち、長さの総和が L 以上のものをひとつ選ぶ。

 選んだひと繋がりのロープに結び目があれば、結び目のうちどれかひとつをほどく。

 

 高橋君は結び目をほどく順番を工夫し、すべての結び目をほどくことができるでしょうか？

 可能か判定し、可能ならば結び目をほどく順番をひとつ求めてください。



=================================================================



解説=============================================================



 結び目を解く順番によらず、いずれ紐は二本が繋がった ai + a_i+1 := len の長さを扱わなくては行けなくなる

 逆にこの len が len >= L であれば、この二本が入ったグループが残されるように両端から紐を解いて行けば良いので

 

 possible か impossibleかどうかの判定は ai + a_i+1 >= L の判定でできる

 

================================================================

*/



struct sec{

    ll l,r,len;

    sec(){}

    sec(ll l,ll r,ll len):l(l),r(r),len(len){}

};

void solve(){

    int N,L; cin >> N >> L;

    vector<int> a(N);

    for(auto &in:a) cin >> in;

    for(int i = 0; i < N-1;i++){

        if(a[i] + a[i+1] >= L){

            cout << "Possible" << endl;

            for(int j = 1; j <= i;j++) cout << j << endl;

            for(int j = N - 1; j > i; j--) cout << j << endl;

            return;

        }

    }

    cout << "Impossible" << endl;

}

int main(void) {

	cin.tie(0); ios::sync_with_stdio(false);

    solve();

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.341756736370731x):
#include <stdio.h>

#include <stdlib.h>

#define MN 100000

int n,l,a[MN+5],b;

int main(){

	scanf("%d%d",&n,&l);

	for(int i=1;i<=n;i++)

		scanf("%d",&a[i]);

	for(b=1;b<=n-1;b++)

		if(a[b]+a[b+1]>=l)break;

	if(b==n) puts("Impossible"),exit(0);

	puts("Possible");

	for(int i=1;i<b;i++)

		printf("%d\n",i);

	for(int i=n-1;i>b;i--)

		printf("%d\n",i);

	printf("%d\n",b);

}
// Slower C++ solution:
#include<set>

#include<map>

#include<stack>

#include<queue>

#include<deque>

#include<cmath>

#include<cstdio>

#include<cctype>

#include<string>

#include<vector>

#include<cstdlib>

#include<cstring>

#include<sstream>

#include<iostream>

#include<algorithm>

#define MAXN 100000



using namespace std;

int a[MAXN+80];

int main()

{

	int i,j,n,L;

	scanf("%d%d",&n,&L);

	for(i=1;i<=n;i++)

		scanf("%d",a+i);

	for(i=1;i<n&&a[i]+a[i+1]<L;i++);

	if(i==n)

	{

		printf("Impossible\n");

		return 0;

	}

	puts("Possible");

	for(j=1;j<i;j++)

		printf("%d\n",j);

	for(j=n-1;j>i;j--)

		printf("%d\n",j);

	printf("%d\n",i);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.177130089478873x):
#include<stdio.h>

int n,l,s[100010];

int main(){

	scanf("%d%d",&n,&l);

	for (int i=0;i<n;i++){

		scanf("%d",s+i);

	}

	for (int i=1;i<n;i++){

		if (s[i]+s[i-1]>=l){

			printf("Possible\n");

			for (int j=1;j<i;j++){

				printf("%d\n",j);

			}

			for (int j=n-1;j>i;j--){

				printf("%d\n",j);

			}

			printf("%d\n",i);

			return 0;

		}

	}

	printf("Impossible\n");

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

using ll = long;

const ll N = 200010;

ll a[N], n, k, pos;

int main()

{

	scanf("%lld%lld", &n, &k);

	for (ll i = 1; i <= n; i++)

		scanf("%lld", a + i);

	for (ll i = 1; i < n; i++)

		if (a[i] + a[i + 1] >= k)

		{

			pos = i;

			break;

		}

	if (pos == 0)

		return puts("Impossible"), 0;

	puts("Possible");

	for (ll i = 1; i < pos; i++)

		printf("%lld\n", i);

	for (ll i = n -1; i > pos ; i--)

		printf("%lld\n", i);

	printf("%lld", pos);

}

// Faster C++ solution for the same problem (measured speedup: 5.167169820181284x):
#include <cstdio>

using namespace std;

using ll = long;

const ll N = 200010;

ll a[N], n, k, pos;

int main()

{

	scanf("%lld%lld", &n, &k);

	for (ll i = 1; i <= n; i++)

		scanf("%lld", a + i);

	for (ll i = 1; i < n; i++)

		if (a[i] + a[i + 1] >= k)

		{

			pos = i;

			break;

		}

	if (pos == 0)

		return puts("Impossible"), 0;

	puts("Possible");

	for (ll i = 1; i < pos; i++)

		printf("%lld\n", i);

	for (ll i = n -1; i > pos ; i--)

		printf("%lld\n", i);

	printf("%lld", pos);

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;

#define ll long long

#define pb push_back

#define mp make_pair

#define PB push_back

#define MP make_pair

#define MOD 1000000000

#define FOR(i,a,b) for(int i=(a);(i)<(b);(i)++)



typedef unsigned int UI;

typedef long long LL;

typedef pair<int, int> PII;

typedef pair<char, int> PCI;

int n , l;

int a[100000];

int curCenterLen;

int L = 0 , R = n - 1;

vector<int> untie;

vector<int> centerPos;

int go(int l , int r)

{

	//cout << l << " " << r << endl;

	printf("Possible\n");

	for(int i = 1; i < l; i++)

	{

		printf("%d\n" , i);

	}

	for(int i = n - 1; i >= r; i--)

		printf("%d\n" , i);

	printf("%d\n" , l);

	exit(0);

}

int main()

{

	scanf("%d %d" , &n , &l);



	for(int i = 0; i < n; i++)

	{

		scanf("%d" , &a[i]);

		if(a[i] == curCenterLen)

		{

			centerPos.pb(i + 1);

			continue;

		}

		if(a[i] > curCenterLen)

		{

			curCenterLen = a[i];

			centerPos.clear();

			centerPos.push_back(i + 1);

		}

	}

	bool can = true;

	for(int i = 0; i < n - 1; i++)

	{

		int curPos = i;

		if(a[curPos] + a[curPos + 1] >= l)

		{

			go(curPos + 1 , curPos + 2);

		}

	}

	cout << "Impossible";

	return 0;

}








// Faster C++ solution for the same problem (measured speedup: 5.306408807992812x):
#include<cstdio>

#include<cstring>

using namespace std;

#define MAXN 100000

long long n,l;

long long fl=0;

long long a[MAXN+5];

long long read()

{

	long long x=0,f=1;

	char c=getchar();

	while('0'>c||c>'9'){if(c=='-') f=-1;c=getchar();}

	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}

	return x*f;

}

int main()

{

	n=read(),l=read();

	for(int i=1;i<=n;i++)

	a[i]=read();

	for(int i=1;i<n;i++)

	{

		if(a[i]+a[i+1]>=l)

		{

			fl=i;

			break;

		}

	}

	if(!fl)

	{

		printf("Impossible\n");

	}

	else 

	{

		printf("Possible\n");

		for(int i=1;i<=fl-1;i++)

			printf("%d\n",i);

		for(int i=n-1;i>=fl;i--)

			printf("%d\n",i);

	}

}
// Slower C++ solution:
#include <cstdio>

#include <cstring>

#include <queue>

#include <algorithm>

#include <iostream>

#include <vector>

#include <unordered_map>

//#include <bits/stdc++.h>

#include <cassert>

#include <map>

#include <bitset>

using namespace std;



#define pb push_back

#define mp make_pair

typedef long long ll;

typedef unsigned long long ull;

typedef pair<int, int> ii;







const int maxn = 1e5+1;

int n, a[maxn], l;



int main()

{

  scanf("%d %d", &n, &l);

  for (int i = 0; i < n; ++i)

    {

      scanf("%d", a+i);

    }

  int tar = -1;

  for (int i = 0; i < n-1; ++i)

    if (a[i]+a[i+1]>=l)

      {

	tar = i;

	break;

      }

  if (tar == -1)

    {

      puts("Impossible");

      return 0;

    }

  puts("Possible");

  tar += 1;

  for (int i = 1; i < tar; ++i)

    printf("%d\n", i);

  for (int i = n-1; i > tar; --i)

    printf("%d\n", i);

  printf("%d\n", tar);

}


// Faster C++ solution for the same problem (measured speedup: 5.25168757178378x):
#include<cstdio>

#include<cstring>

using namespace std;

#define MAXN 100000

long long n,l;

long long fl=0;

long long a[MAXN+5];

long long read()

{

	long long x=0,f=1;

	char c=getchar();

	while('0'>c||c>'9'){if(c=='-') f=-1;c=getchar();}

	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}

	return x*f;

}

int main()

{

	n=read(),l=read();

	for(int i=1;i<=n;i++)

	a[i]=read();

	for(int i=1;i<n;i++)

	{

		if(a[i]+a[i+1]>=l)

		{

			fl=i;

			break;

		}

	}

	if(!fl)

	{

		printf("Impossible\n");

	}

	else 

	{

		printf("Possible\n");

		for(int i=1;i<=fl-1;i++)

			printf("%d\n",i);

		for(int i=n-1;i>=fl;i--)

			printf("%d\n",i);

	}

}
// Slower C++ solution:
#include <stdio.h>

#include <string.h>

#include <iostream>

#include <algorithm>

#define R register

typedef long long ll;

namespace IO{

	char buf[1<<15],*S,*T;

	inline char gc(){

		if (S==T){

			T=(S=buf)+fread(buf,1,1<<15,stdin);

			if (S==T) return EOF;

		}return *S++;

	}

	inline int read(){

		R int x; R bool f; R char c;

		for (f=0; (c=gc())<'0'||c>'9'; f=c=='-');

		for (x=c^'0'; (c=gc())>='0'&&c<='9'; x=(x<<1)+(x<<3)+(c^'0'));

		return f?-x:x;

	}

}

int n,a[100005],L;

int main(){

	n=IO::read(),L=IO::read();for (R int i=1; i<=n; ++i) a[i]=IO::read();

	for (R int i=1; i<n; ++i)

		if (a[i]+a[i+1]>=L){

			puts("Possible");

			for (R int j=1; j<i; ++j) 

				printf("%d\n",j);

			for (R int j=n; --j>i; )

				printf("%d\n",j);

			printf("%d\n",i);

			return 0;

		}puts("Impossible");return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.23576211188632x):
#include<cstdio>

#include<cstring>

using namespace std;

#define MAXN 100000

long long n,l;

long long fl=0;

long long a[MAXN+5];

long long read()

{

	long long x=0,f=1;

	char c=getchar();

	while('0'>c||c>'9'){if(c=='-') f=-1;c=getchar();}

	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}

	return x*f;

}

int main()

{

	n=read(),l=read();

	for(int i=1;i<=n;i++)

	a[i]=read();

	for(int i=1;i<n;i++)

	{

		if(a[i]+a[i+1]>=l)

		{

			fl=i;

			break;

		}

	}

	if(!fl)

	{

		printf("Impossible\n");

	}

	else 

	{

		printf("Possible\n");

		for(int i=1;i<=fl-1;i++)

			printf("%d\n",i);

		for(int i=n-1;i>=fl;i--)

			printf("%d\n",i);

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define mp make_pair

#define X first

#define Y second

#define pii pair<ll,ll>

#define x1 dlfjl

#define x2 dkfj

#define x3 dflgkg

#define y1 dskgj

#define y2 dskfj

#define y3 dfhgdh

#define SQ 320

#define PI 3.14159265359

#define MOD 1000000007

typedef int ll;

using namespace std;

ll n,i,j,k,z,m,q,r,timer,v,tot,x,y,xx, yy,INF, sz;

ll a[100500], cnt[100500];

int main() {

    //freopen("input.txt","r",stdin);

    cin >> n >> k;

    for (int i = 0; i < n; i++)

        cin >> a[i];

    for (int i = 0; i+1 < n; i++) {

        if (a[i] + a[i+1] >= k) {

            cout << "Possible" << endl;

            for (int j = 0; j < i; j++)

                cout << j+1 << endl;

            for (int j = n-2; j > i; j--)

                cout << j+1 << endl;

            cout << i+1 << endl;

            return 0;

        }

    }

    cout << "Impossible" << endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.318569978349632x):
#include<cstdio>

#include<cstring>

using namespace std;

#define MAXN 100000

long long n,l;

long long fl=0;

long long a[MAXN+5];

long long read()

{

	long long x=0,f=1;

	char c=getchar();

	while('0'>c||c>'9'){if(c=='-') f=-1;c=getchar();}

	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}

	return x*f;

}

int main()

{

	n=read(),l=read();

	for(int i=1;i<=n;i++)

	a[i]=read();

	for(int i=1;i<n;i++)

	{

		if(a[i]+a[i+1]>=l)

		{

			fl=i;

			break;

		}

	}

	if(!fl)

	{

		printf("Impossible\n");

	}

	else 

	{

		printf("Possible\n");

		for(int i=1;i<=fl-1;i++)

			printf("%d\n",i);

		for(int i=n-1;i>=fl;i--)

			printf("%d\n",i);

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

long long n,l,a[100001];

int main()

{

    cin>>n>>l;

    

        for(int i=1;i<=n;i++)

            cin>>a[i];

        int flag=0;

        for(int i=1;i<=n-1;i++)

        {

            if(a[i]+a[i+1]>=l)

            {

                flag=i;

                break;

            }

        }

        if(flag!=0)

            cout<<"Possible"<<endl;

        else{

        	 cout<<"Impossible";

        	 return 0;

		}

        for(int i=1;i<flag;++i)

        {

        	printf("%d\n",i);

		}

		for(int j=n-1;j>=flag+1;--j){

			printf("%d\n",j);

		}

		cout<<flag;

    

}

// Faster C++ solution for the same problem (measured speedup: 5.321387247245282x):
#include<cstdio>

#include<cstring>

using namespace std;

#define MAXN 100000

long long n,l;

long long fl=0;

long long a[MAXN+5];

long long read()

{

	long long x=0,f=1;

	char c=getchar();

	while('0'>c||c>'9'){if(c=='-') f=-1;c=getchar();}

	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}

	return x*f;

}

int main()

{

	n=read(),l=read();

	for(int i=1;i<=n;i++)

	a[i]=read();

	for(int i=1;i<n;i++)

	{

		if(a[i]+a[i+1]>=l)

		{

			fl=i;

			break;

		}

	}

	if(!fl)

	{

		printf("Impossible\n");

	}

	else 

	{

		printf("Possible\n");

		for(int i=1;i<=fl-1;i++)

			printf("%d\n",i);

		for(int i=n-1;i>=fl;i--)

			printf("%d\n",i);

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define SC scanf

using namespace std;



int len[200001];



int main()

{

	long long n,l;

	SC("%lld %lld",&n,&l);

	for(long long i = 1; i <= n; i++)

	{

		SC("%d",&len[i]);

	}

	for(int i = 1; i < n; i++)

	{

		if(len[i] + len[i+1] >= l)

		{

			printf("Possible\n");

			for(int j = 1; j <= i-1; j++)

			{

				printf("%d\n",j);

			}

			for(int j = n-1; j >= i+1; j--)

			{

				printf("%d\n",j);

			}

			printf("%d",i);

			return 0;

		}

	}

	printf("Impossible");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.250848571537299x):
#include<cstdio>

#include<cstring>

using namespace std;

#define MAXN 100000

long long n,l;

long long fl=0;

long long a[MAXN+5];

long long read()

{

	long long x=0,f=1;

	char c=getchar();

	while('0'>c||c>'9'){if(c=='-') f=-1;c=getchar();}

	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}

	return x*f;

}

int main()

{

	n=read(),l=read();

	for(int i=1;i<=n;i++)

	a[i]=read();

	for(int i=1;i<n;i++)

	{

		if(a[i]+a[i+1]>=l)

		{

			fl=i;

			break;

		}

	}

	if(!fl)

	{

		printf("Impossible\n");

	}

	else 

	{

		printf("Possible\n");

		for(int i=1;i<=fl-1;i++)

			printf("%d\n",i);

		for(int i=n-1;i>=fl;i--)

			printf("%d\n",i);

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define mp make_pair

#define X first

#define Y second

#define pii pair<ll,ll>

#define x1 dlfjl

#define x2 dkfj

#define x3 dflgkg

#define y1 dskgj

#define y2 dskfj

#define y3 dfhgdh

#define SQ 320

#define PI 3.14159265359

#define MOD 1000000007

typedef int ll;

using namespace std;

ll n,i,j,k,z,m,q,r,timer,v,tot,x,y,xx, yy,INF, sz;

ll a[100500], cnt[100500];

int main() {

    //freopen("input.txt","r",stdin);

    cin >> n >> k;

    for (int i = 0; i < n; i++)

        cin >> a[i];

    for (int i = 0; i+1 < n; i++) {

        if (a[i] + a[i+1] >= k) {

            cout << "Possible" << endl;

            for (int j = 0; j < i; j++)

                cout << j+1 << endl;

            for (int j = n-2; j > i; j--)

                cout << j+1 << endl;

            cout << i+1 << endl;

            return 0;

        }

    }

    cout << "Impossible" << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.318569978349632x):
#include<cstdio>

#include<cstring>

using namespace std;

#define MAXN 100000

long long n,l;

long long fl=0;

long long a[MAXN+5];

long long read()

{

	long long x=0,f=1;

	char c=getchar();

	while('0'>c||c>'9'){if(c=='-') f=-1;c=getchar();}

	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}

	return x*f;

}

int main()

{

	n=read(),l=read();

	for(int i=1;i<=n;i++)

	a[i]=read();

	for(int i=1;i<n;i++)

	{

		if(a[i]+a[i+1]>=l)

		{

			fl=i;

			break;

		}

	}

	if(!fl)

	{

		printf("Impossible\n");

	}

	else 

	{

		printf("Possible\n");

		for(int i=1;i<=fl-1;i++)

			printf("%d\n",i);

		for(int i=n-1;i>=fl;i--)

			printf("%d\n",i);

	}

}

//
// Slower C++ solution:
#include <bits/stdc++.h>

#define mp make_pair

#define X first

#define Y second

#define pii pair<ll,ll>

#define x1 dlfjl

#define x2 dkfj

#define x3 dflgkg

#define y1 dskgj

#define y2 dskfj

#define y3 dfhgdh

#define SQ 320

#define PI 3.14159265359

#define MOD 1000000007

typedef int ll;

using namespace std;

int  n,i,j,k,z,m,q,r,timer,v,tot,x,y,xx, yy,INF, sz;

int a[100500], cnt[100500];

int main() {

    //freopen("input.txt","r",stdin);

    cin >> n >> k;

    for (int i = 0; i < n; i++)

        cin >> a[i];

    for (int i = 1; i < n; i++) {

        if (a[i - 1] + a[i] >= k) {

            cout << "Possible" << endl;

            for (int j = 1; j < i; j++)

                cout << j << endl;

            for (int j = n-1; j > i; j--)

                cout << j << endl;

            cout << i << endl;

            return 0;

        }

    }

    cout << "Impossible" << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.318594074209451x):
#include<cstdio>

#include<cstring>

using namespace std;

#define MAXN 100000

long long n,l;

long long fl=0;

long long a[MAXN+5];

long long read()

{

	long long x=0,f=1;

	char c=getchar();

	while('0'>c||c>'9'){if(c=='-') f=-1;c=getchar();}

	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}

	return x*f;

}

int main()

{

	n=read(),l=read();

	for(int i=1;i<=n;i++)

	a[i]=read();

	for(int i=1;i<n;i++)

	{

		if(a[i]+a[i+1]>=l)

		{

			fl=i;

			break;

		}

	}

	if(!fl)

	{

		printf("Impossible\n");

	}

	else 

	{

		printf("Possible\n");

		for(int i=1;i<=fl-1;i++)

			printf("%d\n",i);

		for(int i=n-1;i>=fl;i--)

			printf("%d\n",i);

	}

}

//
// Slower C++ solution:
#include <bits/stdc++.h>

#define mp make_pair

#define X first

#define Y second

#define pii pair<ll,ll>

#define x1 dlfjl

#define x2 dkfj

#define x3 dflgkg

#define y1 dskgj

#define y2 dskfj

#define y3 dfhgdh

#define SQ 320

#define PI 3.14159265359

#define MOD 1000000007

typedef int ll;

using namespace std;

int  n,i,j,k,z,m,q,r,timer,v,tot,x,y,xx, yy,INF, sz;

int a[100500], cnt[100500];

int main() {

    //freopen("input.txt","r",stdin);

    cin >> n >> k;

    for (int i = 0; i < n; i++)

    {

    	cin >> a[i];

    	if (i == 0) continue;

    	if (a[i - 1] + a[i] >= k) {

            cout << "Possible" << endl;

            for (int j = 1; j < i; j++)

                cout << j << endl;

            for (int j = n-1; j > i; j--)

                cout << j << endl;

            cout << i << endl;

            return 0;

        }

	}

        

    cout << "Impossible" << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.315604976309848x):
#include<cstdio>

#include<cstring>

using namespace std;

#define MAXN 100000

long long n,l;

long long fl=0;

long long a[MAXN+5];

long long read()

{

	long long x=0,f=1;

	char c=getchar();

	while('0'>c||c>'9'){if(c=='-') f=-1;c=getchar();}

	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}

	return x*f;

}

int main()

{

	n=read(),l=read();

	for(int i=1;i<=n;i++)

	a[i]=read();

	for(int i=1;i<n;i++)

	{

		if(a[i]+a[i+1]>=l)

		{

			fl=i;

			break;

		}

	}

	if(!fl)

	{

		printf("Impossible\n");

	}

	else 

	{

		printf("Possible\n");

		for(int i=1;i<=fl-1;i++)

			printf("%d\n",i);

		for(int i=n-1;i>=fl;i--)

			printf("%d\n",i);

	}

}

//