#include <bits/stdc++.h>
using namespace std;
int main() {
  set<pair<long, long> > s;
  vector<pair<long, long> > v;
  set<pair<long, long> >::iterator itr;
  pair<long, long> p;
  long n, m;
  cin >> n >> m;
  long a, b;
  cin >> a >> b;
  for (int i = 1; i <= n; i++) {
    long x, y;
    cin >> x >> y;
    long num = a * x + b * y;
    p.first = num;
    p.second = i;
    v.push_back(p);
  }
  sort(v.begin(), v.end());
  long long sum = 0;
  int count = 0, index = -1;
  for (int i = 0; i < v.size(); i++) {
    if ((v[i].first + sum) <= m) {
      index = i;
      sum += v[i].first;
    } else {
      break;
    }
  }
  cout << index + 1 << endl;
  for (int i = 0; i <= index; i++) {
    cout << v[i].second << " ";
  }
}
