#include <bits/stdc++.h>
using namespace std;
void IOS() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
}
int32_t main() {
  IOS();
  long long int n, m;
  cin >> n >> m;
  pair<long long int, long long int> p[n];
  for (long long int i = 0; i < n; i++) {
    cin >> p[i].first >> p[i].second;
  }
  vector<long long int> v;
  for (long long int i = 1; i <= m; i++) {
    long long int flag = 0;
    for (long long int j = 0; j < n; j++) {
      if (i >= p[j].first && i <= p[j].second) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      v.push_back(i);
    }
  }
  cout << v.size() << endl;
  for (long long int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
}
