#include <bits/stdc++.h>
using namespace std;
struct node {
  long long d, g, s, item;
};
node a[1000000];
bool cmp(node a, node b) { return a.s < b.s; }
int main() {
  long long n, m;
  cin >> n >> m;
  long long x, y;
  cin >> x >> y;
  for (long long i = 0; i < n; i++) {
    scanf("%lld%lld", &a[i].d, &a[i].g);
    a[i].item = i + 1;
    a[i].s = a[i].d * x + a[i].g * y;
  }
  sort(a, a + n, cmp);
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    if (m >= a[i].s) {
      sum++;
      m -= a[i].s;
    } else
      break;
  }
  cout << sum << endl;
  for (long long i = 0; i < sum; i++) {
    if (i == 0)
      printf("%lld", a[i].item);
    else
      printf(" %lld", a[i].item);
  }
  return 0;
}
