#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-9;
const int Mod = 1e9 + 7;
const int MaxN = 1e5 + 5;
int vis[105];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    int l, r;
    cin >> l >> r;
    for (int j = l; j <= r; j++) vis[j] = 1;
  }
  int cnt = 0;
  for (int i = 1; i <= m; i++) {
    if (!vis[i]) cnt++;
  }
  cout << cnt << endl;
  for (int i = 1; i <= m; i++) {
    if (!vis[i]) {
      cout << i << " ";
    }
  }
  return 0;
}
