#include <bits/stdc++.h>
using namespace std;
int n, m, l, r, d, b[110];
void input() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  d = m;
  for (int i = 1; i <= n; ++i) {
    cin >> l >> r;
    for (int j = l; j <= r; ++j) {
      b[j]++;
      if (b[j] == 1) d--;
    }
  }
}
void output() {
  cout << d << "\n";
  for (int i = 1; i <= m; ++i)
    if (b[i] == 0) cout << i << ' ';
}
int main() {
  input();
  output();
  return 0;
}
