#include <bits/stdc++.h>
using namespace std;
int abs(int a) { return a < 0 ? -1 * a : a; }
void solve() {
  int n, d, c, b;
  map<long long, vector<int> > v;
  cin >> n >> d;
  cin >> c >> b;
  set<long long> f;
  int r = d;
  long long a[n], x, y, ct = 0;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    a[i] = (c * x + b * y);
    v[a[i]].push_back(i);
    f.insert(a[i]);
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (r - a[i] >= 0) {
      ct++;
      r -= a[i];
    }
  }
  if (ct) {
    cout << ct << endl;
    for (auto i : f) {
      auto w = v[i];
      for (int j = 0; j < w.size(); j++) {
        if (d - i >= 0) {
          d -= i;
          cout << w[j] + 1 << " ";
        } else {
          return;
        }
      }
    }
  } else {
    cout << 0;
    return;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t = 1;
  solve();
  return 0;
}
