#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, d;
  cin >> n >> d;
  long long a, b;
  cin >> a >> b;
  long long x, y;
  vector<pair<long long, long long>> memories(n);
  long long memory = 0;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    memory = x * a + y * b;
    memories[i].first = memory;
    memories[i].second = i + 1;
  }
  sort(memories.begin(), memories.end());
  long long ans = 0;
  vector<long long> order;
  for (int i = 0; i < n; i++) {
    if (d - memories[i].first >= 0) {
      d -= memories[i].first;
      ans++;
      order.push_back(memories[i].second);
    } else {
      break;
    }
  }
  cout << ans << "\n";
  for (long long o : order) {
    cout << o << ' ';
  }
  return 0;
}
