#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
using llu = long long unsigned;
using ld = long double;
const ld EPS = 1e-9;
inline int cmp(ld first, ld second = 0, ld tol = EPS) {
  return (first <= second + tol) ? (first + tol < second) ? -1 : 0 : 1;
}
const int MOD = 1;
inline int mod(ll first, int m = MOD) { return (int)(((first % m) + m) % m); }
ll n, d, a, b;
vector<pair<ll, int>> vec;
int main() {
  scanf("%lld %lld", &n, &d);
  scanf("%lld %lld", &a, &b);
  for (int i = 1; i <= n; i++) {
    ll first, second;
    scanf("%lld %lld", &first, &second);
    vec.push_back({a * first + b * second, i});
  }
  sort(vec.begin(), vec.end());
  vector<int> ans;
  for (int i = 0; i < ((int)(vec).size()); i++) {
    if (vec[i].first <= d) {
      ans.push_back(vec[i].second);
      d -= vec[i].first;
    } else
      break;
  }
  printf("%d\n", ((int)(ans).size()));
  for (int i = 0; i < ((int)(ans).size()); i++)
    printf("%d%c", ans[i], " \n"[i == ((int)(ans).size()) - 1]);
  return 0;
}
