#include <bits/stdc++.h>
using namespace std;
int n, m, l, r;
bool in[105] = {0};
int k = 0;
int main() {
  cin >> n >> m;
  while (n--) {
    cin >> l >> r;
    for (int ssw = l; ssw <= r; ssw++) {
      if (in[ssw] == 0) {
        in[ssw] = 1;
        k++;
      }
    }
  }
  cout << m - k << '\n';
  for (int ssw = 1; ssw <= m; ssw++) {
    if (in[ssw] == 0) {
      cout << ssw << ' ';
    }
  }
  return 0;
}
