#include <bits/stdc++.h>
using namespace std;
const double oo = 0x3f3f3f3f;
const double eps = 1e-9;
vector<int> ppl;
vector<unsigned long long> vs;
bool comp(int a, int b) { return (vs[a] < vs[b]); }
int main() {
  int n, d;
  int a, b;
  cin >> n >> d;
  cin >> a >> b;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    vs.push_back(x * a + y * b);
    ppl.push_back(i);
  }
  sort(ppl.begin(), ppl.end(), comp);
  stringstream ss;
  unsigned long long cap = 0;
  int xx = 0;
  while (cap < d && xx < n) {
    if (vs[ppl[xx]] + cap <= d) {
      ss << (ppl[xx] + 1) << " ";
      cap += vs[ppl[xx]];
      xx++;
    } else {
      break;
    }
  }
  cout << xx << "\n" << ss.str();
  return 0;
}
