#include <bits/stdc++.h>
int arr[150];
int temp[150];
int main() {
  int n, m;
  std::cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    int a, b;
    std::cin >> a >> b;
    for (int j = a; j <= b; ++j) arr[j]++;
  }
  int cnt = 0;
  for (int i = 1; i <= m; ++i) {
    if (!arr[i]) temp[cnt++] = i;
  }
  std::cout << cnt << std::endl;
  for (int i = 0; i < cnt; ++i) {
    if (!i)
      std::cout << temp[i];
    else
      std::cout << ' ' << temp[i];
  }
  if (cnt) std::cout << std::endl;
  return 0;
}
