stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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;

}








// Optimized solution to the same problem (faster):
#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);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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);

}


// Optimized solution to the same problem (faster):
#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);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

    

}

// Optimized solution to the same problem (faster):
#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);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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);

	}

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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);

	}

}

//

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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);

	}

}

//

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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);

	}

}

//

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

    int lst = 0;

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

    {

    	cin >> x;

    	if (i == 0)

		{

			lst = x;

			continue;

		}

    	if (lst + x >= 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;

        }

        lst = x;

	}

        

    cout << "Impossible" << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#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);

	}

}

//

// Fastest known solution for this problem:
// Original C++ solution (slower):
//By Don4ick 

//#define _GLIBCXX_DEBUG



#include <bits/stdc++.h>



typedef long long ll;

typedef long double ld;

typedef unsigned int ui;



#define forn(i, n) for (int i = 1; i <= n; i++)

#define pb push_back

#define all(x) x.begin(), x.end()

#define y1 qewr1234



const double PI = acos(-1.0);

const int DIR = 4;

const int X[] = {1, 0, -1, 0};

const int Y[] = {0, 1, 0, -1};



const int N = (int)1e5 + 228;



using namespace std;



int n, k, a[N];

ll pref[N];



int main()

{

	//ios_base::sync_with_stdio(false);

	//cin.tie();

	//cout.tie();		



	//freopen(".in", "r", stdin);

	//freopen(".out", "w", stdout);



	//~read

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

	forn(i, n)

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

	//~solve

	forn(i, n - 1)

	{

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

		{

			cout << "Possible" << endl;

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

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

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

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

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

			return 0;

		}

	}

	cout << "Impossible" << endl;

	return 0;

}




// Optimized solution to the same problem (faster):
#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);

	}

}

//

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>



using namespace std;



const int Maxn = 100010;



int n , l;

int a[Maxn];



int main() {

	

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

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

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

	

	register int tmp = -1;

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

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

			tmp = i;

			break;

		}

	}

	

	if(tmp == -1) {

		puts("Impossible");

		return 0;

	}

	

	puts("Possible");

	

	for(register int i=1; i<=tmp-1; i++)

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

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

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

	

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

	

	return 0;

	

}

// Optimized solution to the same problem (faster):
#include <cstdio>



const int Maxn = 100010;



int n , l;

int a[Maxn];



int main() {

	

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

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

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

	

	register int tmp = -1;

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

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

			tmp = i;

			break;

		}

	}

	

	if(tmp == -1)	return !puts("Impossible");

	

	puts("Possible");

	

	for(register int i=1; i<=tmp-1; i++)

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

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

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

	

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

	

	return 0;

	

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int sum(int n)

{

    int x=0;

    while(n)

    {

        x+=n%10;n/=10;

    }

    return x;

}

int main()

{

    int n,a,b,x; long long int cnt=0;

    cin >> n >> a >> b;

    n++;

    while(n--)

    {

        x= sum(n);

        if(x>=a&&x<=b)cnt+=n;

    }

    cout << cnt << endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main(){

    int N,A,B, i, temp, t, remainder, sum, total = 0;

    scanf("%d %d %d", &N,&A,&B);



    for(i = 1; i <= N; i++){

        t = i;

        sum  = 0;

        while (t != 0){

              remainder = t % 10;

              sum += remainder;

              t /= 10;

           }



           if(sum >= A && sum <= B){

               total += i;

        }

    }



    printf("%d", total);



}

// Fastest known solution for this problem:
// Original C++ solution (slower):
//#include<bits/stdc++.h>

//#include<tr1/unordered_map>

#include<iostream>

#include<string>

#pragma GCC optimize ("Ofast")

#define ll long long

#define pll pair<long long,long long>

#define pii pair<int,int>

#define mp make_pair

#define pb push_back

#define F first

#define S second

#define forn(i, n) for(int i=0; i<int(n); i++)

#define Forn(i, n) for(int i=1; i<=int(n); i++)



using namespace std;



/*#include <ext/pb_ds/tree_policy.hpp>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> rbtree;*/



int sum_of_digits(int x)

{

    int ret = 0;

    while(x)

    {

        ret += x%10;

        x/=10;

    }

    return ret;

}



int main()

{

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

    int n, a, b;

    cin >> n >> a >> b;

    int ans = 0;

    Forn(i, n)

    {

        int temp = sum_of_digits(i);

        if(a<=temp && temp<=b) ans += i;

    }

    cout << ans << endl;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main(){

    int N,A,B, i, temp, t, remainder, sum, total = 0;

    scanf("%d %d %d", &N,&A,&B);



    for(i = 1; i <= N; i++){

        t = i;

        sum  = 0;

        while (t != 0){

              remainder = t % 10;

              sum += remainder;

              t /= 10;

           }



           if(sum >= A && sum <= B){

               total += i;

        }

    }



    printf("%d", total);



}

// Fastest known solution for this problem: