#include <bits/stdc++.h>
using namespace std;
int n, m, l, r, cnt;
int a[105];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> l >> r;
    for (int i = l; i <= r; ++i) {
      a[i] = 1;
    }
  }
  for (int i = 1; i <= m; ++i) {
    if (!a[i]) cnt++;
  }
  cout << cnt << endl;
  for (int i = 1; i <= m; ++i) {
    if (!a[i]) cout << i << " ";
  }
  cout << endl;
  return 0;
}
