#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, a, b;
  int vis[105];
  memset(vis, 0, sizeof(vis));
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &a, &b);
    for (j = a; j <= b; j++) {
      vis[j] = 1;
    }
  }
  int ans = 0;
  vector<int> V;
  for (i = 1; i <= m; i++) {
    if (!vis[i]) {
      ans++;
      V.push_back(i);
    }
  }
  printf("%d\n", ans);
  if (ans != 0) {
    for (i = 0; i < V.size() - 1; i++) {
      printf("%d ", V[i]);
    }
    printf("%d\n", V[i]);
  }
  return 0;
}
