#include <bits/stdc++.h>
using namespace std;
int v[101];
int main() {
  int n, m;
  cin >> n >> m;
  memset(v, 0, sizeof(v));
  int l, r;
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &l, &r);
    for (int j = l; j <= r; j++) {
      v[j] = 1;
    }
  }
  int cnt = 0;
  for (int i = 1; i <= m; i++) {
    if (v[i] == 0) cnt++;
  }
  cout << cnt << endl;
  for (int i = 1; i <= m; i++) {
    if (v[i] == 0) cout << i << " ";
  }
  return 0;
}
