#include <bits/stdc++.h>
using namespace std;
struct photo {
  long long int ind;
  long long int l, h;
  long long int tot;
};
bool comp(const photo A, const photo B) {
  if (A.tot < B.tot) return true;
  return false;
}
int main() {
  long long int n, d, a, b, i, j, sum = 0, c = 0;
  photo obj[100001];
  cin >> n >> d >> a >> b;
  for (i = 0; i < n; ++i) {
    long long int first, second;
    cin >> first >> second;
    obj[i].ind = i;
    obj[i].l = first;
    obj[i].h = second;
    obj[i].tot = first * a + second * b;
  }
  sort(obj, obj + n, comp);
  for (i = 0; i < n && sum <= d; ++i) {
    if (sum + obj[i].tot > d) break;
    sum += obj[i].tot;
    ++c;
  }
  cout << c << "\n";
  for (i = 0; i < c; ++i) {
    cout << obj[i].ind + 1 << " ";
  }
}
