#include <bits/stdc++.h>
using namespace std;
struct node {
  int val;
  int num;
} c[100010];
bool cmp(node a, node b) { return a.val < b.val; }
int main() {
  int n, d, a, b, u, v, res = 0;
  scanf("%d%d%d%d", &n, &d, &a, &b);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &u, &v);
    c[i].val = u * a + v * b;
    c[i].num = i;
  }
  sort(c + 1, c + 1 + n, cmp);
  int i;
  for (i = 1; i <= n; i++) {
    if (d - c[i].val < 0) {
      res = i - 1;
      break;
    }
    d = d - c[i].val;
  }
  if (i == n + 1) res = n;
  printf("%d\n", res);
  for (int i = 1; i <= res; i++) printf("%d ", c[i].num);
  return 0;
}
