#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[102], n, m, l, r, cnt;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < 101; i++) arr[i] = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &l, &r);
    for (int j = l; j <= r; j++) {
      arr[j] = 1;
    }
  }
  cnt = 0;
  for (int i = 1; i <= m; i++) {
    if (arr[i] == 0) cnt++;
  }
  printf("%d\n", cnt);
  for (int i = 1; i <= m; i++) {
    if (arr[i] == 0) {
      printf("%d ", i);
    }
  }
  return 0;
}
