#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int l, r;
  int cnt = 0;
  int num[101] = {0};
  int res[101] = {0};
  for (size_t i = 0; i < n; i++) {
    cin >> l >> r;
    for (size_t j = l; j <= r; j++) {
      num[j]++;
    }
  }
  for (size_t i = 1, j = 0; i <= m; i++) {
    if (num[i] == 0) {
      res[j] = i;
      cnt++;
      j++;
    }
  }
  cout << cnt << endl;
  for (size_t i = 0; i < cnt; i++) {
    cout << res[i] << endl;
  }
}
