#include <bits/stdc++.h>
int array[101];
int main() {
  int n, m, i, count = 0, l, r;
  scanf("%d %d", &n, &m);
  while (n > 0) {
    scanf("%d %d", &l, &r);
    for (i = l; i <= r; i++) array[i] = 1;
    n--;
  }
  for (i = 1; i <= m; i++) {
    if (array[i] == 0) count++;
  }
  printf("%d\n", count);
  for (i = 1; i <= m; i++) {
    if (array[i] == 0) printf("%d ", i);
  }
  printf("\n");
  return 0;
}
