#include <bits/stdc++.h>
using namespace std;
int aa[110];
int main() {
  int n, m, a, b, cont = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a >> b;
    for (int j = a; j <= b; j++) {
      if (aa[j] == 0) {
        cont++;
        aa[j] = 1;
      }
    }
  }
  int res = m - cont;
  cout << res << endl;
  for (int i = 1; i <= m; i++)
    if (aa[i] == 0) cout << i << " ";
  cout << endl;
}
