#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, ans;
bool used[105];
int main() {
  cin >> n >> m;
  while (n--) {
    cin >> x >> y;
    for (int i = x; i <= y; i++) used[i] = 1;
  }
  for (int i = 1; i <= m; i++)
    if (!used[i]) ans++;
  cout << ans << endl;
  for (int i = 1; i <= m; i++)
    if (!used[i]) cout << i << ' ';
  cout << endl;
  return 0;
}
