#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const long long INF64 = 1e18;
const int N = 1e5 + 5;
bool bound[105];
vector<int> ans;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    for (int j = a; j <= b; j++) bound[j] = 1;
  }
  for (int i = 1; i <= m; i++) {
    if (!bound[i]) ans.push_back(i);
  }
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < ans.size(); i++)
    printf("%d%c", ans[i], i == (int)ans.size() - 1 ? '\n' : ' ');
  return 0;
}
