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