#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int mas[102] = {0};
  mas[0] = 1;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    mas[l] = 1;
    mas[r] = 1;
    for (int j = 1; j < r - l; j++) {
      mas[l + j] = 1;
    }
  }
  int k = 0;
  for (int i = 0; i <= m; i++) {
    if (mas[i] == 0) {
      k++;
    }
  }
  cout << k << endl;
  if (k != 0) {
    for (int i = 0; i <= m; i++) {
      if (mas[i] == 0) {
        cout << i << " ";
      }
    }
  }
  return 0;
}
