#include <bits/stdc++.h>
using namespace std;
int a[1000];
int b[1000];
int n, m;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    for (int i = x; i <= y; i++) a[i] = 1;
  }
  int ans = 0;
  int cnt = 0;
  for (int i = 1; i <= m; i++) {
    if (a[i] == 0) {
      b[ans++] = i;
      cnt++;
    }
  }
  cout << cnt << endl;
  for (int i = 0; i < ans; i++) {
    cout << b[i] << " ";
  }
  cout << endl;
  return 0;
}
