#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> ind;
  vector<pair<int, int>> vec;
  int n, tt, a, b, arr[900001], ans = 0;
  cin >> n >> tt >> a >> b;
  for (int ii = 0; ii < n; ii++) {
    int x, y;
    cin >> x >> y;
    arr[ii] = (x * a) + (y * b);
  }
  for (int i = 0; i < n; i++) {
    vec.push_back({arr[i], i + 1});
  }
  sort(vec.begin(), vec.end());
  for (auto u : vec) {
    if (tt >= u.first) {
      tt -= u.first;
      ind.push_back(u.second);
    }
  }
  cout << ind.size() << endl;
  for (auto u : ind) {
    cout << u << " ";
  }
}
