#include <bits/stdc++.h>
using namespace std;
const int inf = 1000 * 2000 * 1000, MOD = 1000 * 1000 * 1000 + 7;
const long long INF = 1000 * 1LL * 1000000 * 1000 * 1000000;
int n;
vector<int> ans;
long long a, b, d;
struct qwe {
  long long x, y;
  int p;
};
qwe ar[200000];
bool cmp(qwe p1, qwe p2) {
  return ((p1.x * a) + (p1.y * b)) < ((p2.x * a) + (p2.y * b));
}
int main() {
  srand(time(NULL));
  cin >> n;
  cin >> d;
  cin >> a >> b;
  for (int i = 1; i <= n; i++) {
    cin >> ar[i].x >> ar[i].y;
    ar[i].p = i;
  }
  sort(ar + 1, ar + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    if (d >= (ar[i].x * a)) {
      d -= (ar[i].x * a);
    } else {
      break;
    }
    if (d >= (ar[i].y * b)) {
      d -= (ar[i].y * b);
    } else {
      break;
    }
    ans.push_back(ar[i].p);
  }
  cout << ans.size() << endl;
  for (int i = 1; i <= ans.size(); i++) {
    cout << ans[i - 1] << " ";
  }
  return 0;
}
