#include <bits/stdc++.h>
using namespace std;
int c[105] = {0};
vector<int> p;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    for (int j = l; j <= r; j++) {
      c[j]++;
    }
  }
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    if (c[i] == 0) {
      ans++;
      p.push_back(i);
    }
  }
  printf("%d\n", ans);
  for (int i = 0; i < ans; i++) {
    printf("%d", p[i]);
    if (i != ans - 1) printf(" ");
  }
}
