#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
int main() {
  int n, d;
  scanf("%d %d", &n, &d);
  int a, b;
  scanf("%d %d", &a, &b);
  int x, y;
  vector<pair<lli, int>> v(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &x, &y);
    v[i] = {x * a + y * b, i + 1};
  }
  sort(v.begin(), v.end());
  int c = 0;
  vector<int> ind;
  for (; c < n; ++c) {
    if (d - v[c].first >= 0) {
      d -= v[c].first;
      ind.push_back(v[c].second);
    } else
      break;
  }
  cout << c << '\n';
  for (auto pri : ind) cout << pri << " ";
  return 0;
}
