#include <bits/stdc++.h>
using namespace std;
void read_file(bool outToFile = true) {}
int n, d;
int a, b;
int X[100000 + 9], Y[100000 + 9];
pair<long long, int> A[100000 + 9];
int main() {
  read_file();
  while (cin >> n >> d) {
    cin >> a >> b;
    for (int i = 0; i < n; i++)
      cin >> X[i] >> Y[i], A[i].first = 1LL * X[i] * a + Y[i] * b,
                           A[i].second = i + 1;
    sort(A, A + n);
    vector<int> ans;
    for (int i = 0; i < n; i++) {
      if (d >= A[i].first)
        d -= A[i].first, ans.push_back(A[i].second);
      else
        break;
    }
    int sz = ans.size();
    cout << sz << endl;
    for (int i = 0; i < sz; i++) cout << ans[i] << " \n"[i == sz - 1];
  }
}
