#include <bits/stdc++.h>
using namespace std;
int n, m, D[105], dem;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    int u, v;
    cin >> u >> v;
    for (int k = u; k <= v; ++k) D[k] = 1;
  }
  for (int i = 1; i <= m; ++i)
    if (D[i] == 0) dem++;
  cout << dem << '\n';
  for (int i = 1; i <= m; ++i)
    if (D[i] == 0) cout << i << ' ';
}
