#include <bits/stdc++.h>
using namespace std;
bool sorted(const pair<int, int>& p1, const pair<int, int>& p2) {
  return p1.first < p2.first;
}
int main() {
  int n, d, a, b, x, y, sum = 0;
  cin >> n >> d >> a >> b;
  vector<int> ans;
  vector<pair<int, int>> v;
  for (int i = 1; i <= n; i++) {
    cin >> x >> y;
    v.push_back(make_pair(x * a + y * b, i));
  }
  sort(v.begin(), v.end(), sorted);
  for (int i = 0; i < n; i++) {
    if (d - v[i].first >= 0) {
      d -= v[i].first;
      sum++;
      ans.push_back(v[i].second);
    } else
      break;
  }
  cout << sum << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
