#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
pair<int, int> a[MAX];
int main() {
  int n, d;
  cin >> n >> d;
  int A, B, x, y;
  cin >> A >> B;
  for (int i = 0; i < n; ++i) {
    cin >> x >> y;
    a[i].first = x * A + y * B;
    a[i].second = i + 1;
  }
  sort(a, a + n);
  int i = 0;
  while (i < n && d >= a[i].first) {
    d -= a[i].first;
    ++i;
  }
  cout << i << "\n";
  for (int j = 0; j < i; ++j) cout << a[j].second << " ";
  return 0;
}
