#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, a, b;
  cin >> n >> m;
  vector<bool> visited(105, false);
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    for (int i = a; i <= b; i++) {
      visited[i] = true;
    }
  }
  int cnt = 0;
  for (int i = 1; i <= m; i++) {
    if (!visited[i]) {
      cnt++;
    }
  }
  cout << cnt << endl;
  for (int i = 1; i <= m; i++) {
    if (!visited[i]) {
      cout << i << " ";
    }
  }
}
