#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  long long d, sum = 0, c = 0;
  vector<int> ar(100000), arr(100000), res(100000);
  pair<int, int> p[100000];
  cin >> n >> d >> a >> b;
  for (int i = 0; i < n; i++) {
    cin >> ar[i] >> arr[i];
    res[i] = ar[i] * a + arr[i] * b;
    p[i] = make_pair(res[i], i);
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    if (sum + p[i].first <= d) {
      sum += p[i].first;
      c++;
    } else
      break;
  }
  cout << c << endl;
  for (int i = 0; i < c; i++) {
    cout << p[i].second + 1 << " ";
  }
  return 0;
}
