#include <bits/stdc++.h>
using namespace std;
int n, m;
int mark[100];
int main() {
  cin >> n >> m;
  int ans = m;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    l--;
    r--;
    for (int i = l; i <= r; i++) {
      if (!mark[i]) {
        ans--;
        mark[i] = 1;
      }
      mark[i] = 1;
    }
  }
  cout << ans << endl;
  for (int i = 0; i < m; i++) {
    if (!mark[i]) cout << i + 1 << " ";
  }
}
