#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> a(n);
  vector<int> b(110);
  for (int i = 0; i < n; ++i) cin >> a.at(i).first >> a.at(i).second;
  for (int i = 0; i < n; ++i) {
    for (int j = a.at(i).first; j <= a.at(i).second; ++j) {
      b.at(j)++;
    }
  }
  int cnt = 0;
  for (int i = 1; i <= m; ++i) {
    if (b.at(i) == 0) cnt++;
  }
  cout << cnt << endl;
  for (int i = 1; i <= m; ++i) {
    if (b.at(i) == 0 && cnt > 1) {
      cout << i << " ";
      cnt--;
    } else if (b.at(i) == 0 && cnt == 1)
      cout << i << endl;
  }
}
