#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, a, b, x, y;
  cin >> n >> d >> a >> b;
  vector<pair<int, int>> vp;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    vp.push_back({x * a + y * b, i + 1});
  }
  sort(vp.begin(), vp.end());
  long long sum = 0;
  int bb = 0;
  for (int i = 0; i < n; i++)
    if (sum + vp[i].first <= d) {
      sum += vp[i].first;
      bb = i + 1;
    } else
      break;
  cout << bb << endl;
  for (int j = 0; j < bb; j++) cout << vp[j].second << " ";
}
