#include <bits/stdc++.h>
using namespace std;
bool check[109];
int main() {
  int n, m;
  cin >> n >> m;
  memset(check, true, m + 9);
  for (int i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    for (int j = x; j <= y; j++) check[j] = false;
  }
  int dem = 0;
  for (int i = 1; i <= m; i++)
    if (check[i]) dem++;
  cout << dem << endl;
  for (int i = 1; i <= m; i++)
    if (check[i]) cout << i << " ";
  return 0;
}
