/*                                بِسْمِ اللَّـهِ الرَّحْمَـٰنِ الرَّحِيمِ

                                    ( إِنِ الْحُكْمُ إِلَّا لِلَّهِ )

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

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const long double pi=acos(-1);
#define x  first
#define y  second
#define read(n,a) for(int i=0;i<n;i++)cin>>a[i];
#define rep(i,z,n)for(ll i=z;i<n;i++)
#define all(v)    v.begin(),v.end()

pair<int,int> a[200002]={};
ll b[200002]={};

string s="",ss="";

ll n,m,k,w;
ll ans ;
ll mod = 1e9 +7;

int main()
{
    cin.tie(0);
    cin.sync_with_stdio(0);
    //freopen("rect.in","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;
    //cin>>t;
    while(t--)
    {
       cin>>n;
       rep(i,0,1ll<<n)cin>>a[i].x,a[i].y=i;
       n=(1ll<<n);
       n/=2;
       sort(a,a+n);
       sort(a+n,a+n+n);
       if(a[n-1].x<a[n+n-1].x)cout<<a[n-1].y+1;
       else cout<<a[n+n-1].y+1;
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define MOD 1000000007

int main() {
    int n, x;
    cin >> n >> x;
    // vector<int> v(n), p(n);
    int sum = 0;
    rep(i, n) {
        int v, p;
        cin >> v >> p;
        sum += v * p;
        if (x * 100 < sum) {
            cout << i + 1 << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}
