#include <bits/stdc++.h>
using namespace std;
int n, m;
bool a[110];
int main() {
  scanf("%d%d", &n, &m);
  for (register int x, y; n--;) {
    scanf("%d%d", &x, &y);
    for (register int i = x; i <= y; i++) a[i] = true;
  }
  register int ans = 0;
  for (register int i = 1; i <= m; i++)
    if (!a[i]) ans++;
  printf("%d\n", ans);
  if (ans) {
    for (register int i = 1; i <= m; i++)
      if (!a[i]) printf("%d ", i);
    putchar('\n');
  }
  return 0;
}
