#include <bits/stdc++.h>
const int INF = (int)1e9;
using namespace std;
const int MAX = 105;
int n, m, occ[MAX];
vector<int> ans;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  int l, r;
  for (int i = 0; i < n; i++) {
    cin >> l >> r;
    occ[l]++;
    occ[r + 1]--;
  }
  for (int i = 1; i <= m; i++) {
    occ[i] += occ[i - 1];
    if (occ[i]) continue;
    ans.push_back(i);
  }
  cout << ans.size() << '\n';
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  cout << '\n';
  return 0;
}
