#include <bits/stdc++.h>
using namespace std;
struct tim {
  int c, n;
  bool operator<(const tim t) const { return c < t.c; }
} a[1111111];
int num[1111111];
int main() {
  int i, j, m, n, k, t, aa, bb;
  cin >> n >> m;
  cin >> aa >> bb;
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &k, &t);
    a[i].c = k * aa + t * bb;
    a[i].n = i;
  }
  sort(a + 1, a + 1 + n);
  i = 1;
  while (i <= n && m >= a[i].c) num[i] = a[i].n, m -= a[i].c, i++;
  cout << i - 1 << endl;
  for (j = 1; j < i; j++)
    if (j == i - 1)
      printf("%d\n", num[j]);
    else
      printf("%d ", num[j]);
}
