#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, a, b, r1, r2, cnt = 0;
  pair<int, int> client[100010];
  scanf("%d%d%d%d", &n, &d, &a, &b);
  for (; cnt < n; cnt++) {
    scanf("%d%d", &r1, &r2);
    client[cnt].first = r1 * a + r2 * b;
    client[cnt].second = cnt + 1;
  }
  sort(client, client + n);
  cnt = 0;
  for (cnt = 0; cnt < n; cnt++) {
    if (d - client[cnt].first > -1)
      d -= client[cnt].first;
    else
      break;
  }
  printf("%d\n", cnt);
  for (int a = 0; a < cnt; a++) printf("%d ", client[a].second);
}
