#include <bits/stdc++.h>
int n, m;
bool a[105];
int main() {
  scanf("%d%d", &n, &m);
  for (register int i = 1, l, r; i <= n; i++) {
    scanf("%d%d", &l, &r);
    for (register int j = l; j <= r; j++) a[j] = 1;
  }
  register int ans = 0;
  for (register int i = 1; i <= m; i++)
    if (!a[i]) ans++;
  printf("%d\n", ans);
  for (register int i = 1; i <= m; i++)
    if (!a[i]) printf("%d ", i);
  return 0;
}
