#include <bits/stdc++.h>
using namespace std;
bool visited[110];
void setVisited(int L, int R) {
  for (int i = L; i <= R; i++) visited[i] = true;
  return;
}
vector<int> getAnswer(int M) {
  vector<int> ans;
  for (int i = 1; i <= M; i++)
    if (!visited[i]) ans.push_back(i);
  return ans;
}
void showAnswer(vector<int> output) {
  cout << output.size() << endl;
  for (int i = 0; i < output.size(); i++) cout << output[i] << " ";
  cout << endl;
}
int main() {
  long long int N, M;
  cin >> N >> M;
  for (int i = 0; i < N; i++) {
    long long int L, R;
    cin >> L >> R;
    setVisited(L, R);
  }
  showAnswer(getAnswer(M));
}
