#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int l[n], r[n], k = 0, a[100];
  for (int i = 0; i < n; ++i) cin >> l[i] >> r[i];
  for (int i = 1; i <= m; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i >= l[j] && i <= r[j]) break;
      if (j == (n - 1)) {
        a[k] = i;
        k++;
      }
    }
  }
  if (k == 0) {
    cout << k << endl << endl;
    return 0;
  } else
    cout << k << endl;
  for (int i = 0; i < k - 1; ++i) {
    cout << a[i] << " ";
  }
  cout << a[k - 1];
  return 0;
}
