#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, d, a, b;
  cin >> n >> d >> a >> b;
  vector<pair<long long, long long> > v(n);
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    v[i].first = x * a;
    v[i].first += y * b;
    v[i].second = i;
  }
  sort(v.begin(), v.end());
  vector<long long> ans;
  for (long long i = 0; i < n; i++) {
    if (v[i].first <= d) {
      d -= v[i].first;
      ans.push_back(v[i].second + 1);
    }
  }
  cout << ans.size() << '\n';
  for (long long i : ans) cout << i << ' ';
  cout << '\n';
  return 0;
}
