#include <bits/stdc++.h>
using namespace std;
int n, d, a, b, x, y;
struct client {
  long long no, big, small;
};
int capacity(client c) { return c.big * b + c.small * a; }
bool operator<(client x, client y) { return capacity(x) < capacity(y); }
int main() {
  cin >> n >> d;
  cin >> a >> b;
  vector<client> cs;
  cs.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> cs[i].small >> cs[i].big;
    cs[i].no = i + 1;
  }
  sort(cs.begin(), cs.end());
  vector<int> res;
  for (int i = 0; i < n; i++) {
    if (d >= capacity(cs[i])) {
      d -= capacity(cs[i]);
      res.push_back(cs[i].no);
    }
  }
  cout << res.size() << endl;
  for (int i = 0; i < res.size(); i++) {
    cout << res[i] << " ";
  }
  cout << endl;
  return 0;
}
