#include <bits/stdc++.h>
int counter, c;
using namespace std;
int main() {
  int x, z, v, vv;
  cin >> x >> z;
  int arr[109], arr2[109];
  for (int i = 0; i <= z; i++) {
    arr[i] = 1;
  }
  for (int i = 0; i < x; i++) {
    cin >> v >> vv;
    arr[v] = 0;
    for (int i = v; i <= vv; i++) arr[i] = 0;
  }
  for (int i = 1; i <= z; i++) {
    if (arr[i]) {
      counter++;
      arr2[c++] = i;
    }
  }
  cout << counter << endl;
  for (int i = 0; i < c; i++) cout << arr2[i] << "  ";
  return 0;
}
