#include <bits/stdc++.h>
using namespace std;
int arr[101];
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    for (int i = a; i < b + 1; i++) {
      arr[i] = 1;
    }
  }
  vector<int> v;
  for (int i = 1; i < m + 1; i++) {
    if (!arr[i]) v.push_back(i);
  }
  cout << int((v).size()) << endl;
  for (int i = 0; i < int((v).size()); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
  return 0;
}
