#include <bits/stdc++.h>
using namespace std;
int vis[111];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int i, j, k, n, m, l, r;
  vector<int> v;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> l >> r;
    for (j = l; j <= r; j++) vis[j] = 1;
  }
  for (i = 1; i <= m; i++)
    if (vis[i] == 0) v.push_back(i);
  cout << v.size() << endl;
  for (i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
  return 0;
}
