#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  unsigned long long n, d, a, b, i, c, e;
  c = e = 0;
  cin >> n >> d >> a >> b;
  vector<pair<unsigned long long, unsigned long long> > vc(n);
  vector<pair<unsigned long long, unsigned long long> > vt(n);
  for (i = 0; i < n; i++) {
    cin >> vc[i].first >> vc[i].second;
    vt[i].first = vc[i].first * a + vc[i].second * b;
    vt[i].second = i + 1;
  }
  sort(vt.begin(), vt.end());
  for (i = 0; i < n; i++) {
    e += vt[i].first;
    if (e <= d)
      c++;
    else
      break;
  }
  cout << c << "\n";
  for (i = 0; i < c; i++) cout << vt[i].second << " ";
  cout << "\n";
  return 0;
}
