#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, d, a, b, x = 0;
  vector<pair<long long, long long> > v;
  vector<long long> vv;
  cin >> n >> d >> a >> b;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    v.push_back(make_pair((x * a) + (y * b), i + 1));
  }
  sort(v.begin(), v.end());
  for (long long i = 0; i < v.size() && d > 0; i++) {
    if (d - v[i].first >= 0) {
      x++;
      vv.push_back(v[i].second);
      d -= v[i].first;
    }
  }
  cout << x << endl;
  for (long long i = 0; i < vv.size(); i++) {
    cout << vv[i];
    if (i != vv.size() - 1) cout << " ";
  }
  return 0;
}
