#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[101], d[101];
  cin >> n >> m;
  int b, c;
  memset(a, 0, sizeof(a));
  for (int i = 0; i < n; i++) {
    cin >> b >> c;
    for (int g = b; g <= c; g++) {
      a[g] = 1;
    }
  }
  int ant = 0;
  for (int i = 1; i <= m; i++) {
    if (a[i] == 0) {
      d[ant++] = i;
    }
  }
  cout << ant << endl;
  for (int i = 0; i < ant; i++) cout << d[i] << " ";
}
