#include <bits/stdc++.h>
using namespace std;
struct peo {
  long long s;
  int cnt;
} num[100007];
bool cmp(peo A, peo B) { return A.s < B.s; }
int main() {
  int n, d, a, b, l, h;
  while (~scanf("%d%d", &n, &d)) {
    memset(num, 0, sizeof(num));
    scanf("%d%d", &a, &b);
    for (int i = 1; i <= n; i++) {
      scanf("%d%d", &l, &h);
      num[i].s = l * a + h * b;
      num[i].cnt = i;
    }
    sort(num + 1, num + n + 1, cmp);
    long long sum = 0;
    int p = n;
    for (int i = 1; i <= n; i++) {
      sum = sum + num[i].s;
      if (sum > d) {
        p = i - 1;
        break;
      }
    }
    printf("%d\n", p);
    for (int i = 1; i <= p; i++) printf("%d ", num[i].cnt);
    if (p != 0) printf("\n");
  }
  return 0;
}
