#include <bits/stdc++.h>
bool flag[100 + 1];
int main() {
  std ::memset(flag, true, sizeof(flag));
  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) flag[j] = false;
  }
  int ans[101], cnt = 0, s = 1;
  for (int i = 1; i <= m; i++)
    if (flag[i]) {
      cnt++;
      ans[s] = i;
      s++;
    }
  printf("%d\n", cnt);
  if (cnt == 0) return 0;
  for (int i = 1; i < s; ++i) printf("%d ", ans[i]);
  return 0;
}
