#include <bits/stdc++.h>
const int MaxN = 1e5;
using namespace std;
int n, d;
int low, high;
int num[MaxN + 5];
pair<int, int> cnt[MaxN + 5];
bool cmp(pair<int, int> x, pair<int, int> y) { return x.first < y.first; }
int main() {
  while (~scanf("%d%d%d%d", &n, &d, &low, &high)) {
    for (int i = 1; i <= n; i++) {
      int a, b;
      scanf("%d%d", &a, &b);
      cnt[i].first = a * low + b * high;
      cnt[i].second = i;
    }
    sort(cnt + 1, cnt + n + 1, cmp);
    int cont = 0;
    for (int i = 1; i <= n; i++) {
      if (cnt[i].first > d)
        break;
      else
        num[++cont] = cnt[i].second;
      d -= cnt[i].first;
    }
    printf("%d\n", cont);
    for (int i = 1; i <= cont; i++) {
      printf("%d ", num[i]);
    }
    printf("\n");
  }
}
