#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int c[maxn];
int main() {
  int flag = 0, cnt = 0;
  int n, m, a, b;
  cin >> n >> m;
  memset(c, 0, sizeof(0));
  for (int i = 1; i <= n; i++) {
    cin >> a >> b;
    for (int j = a; j <= b; j++) c[j] = 1;
  }
  int k;
  for (k = 1; k <= m; k++) {
    if (c[k] == 0) break;
  }
  if (k > m)
    printf("0\n");
  else {
    for (int i = 1; i <= m; i++) {
      if (c[i] == 0) cnt++;
    }
    printf("%d\n", cnt);
    for (int i = 1; i <= m; i++) {
      if (c[i] == 0) {
        if (flag) printf(" ");
        flag = 1;
        printf("%d", i);
      }
    }
    printf("\n");
  }
  return 0;
}
