#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <math.h>
#include <string>
using namespace std;
int n, m;
bool vis[105];
int ans_index[105];
int main() {
scanf("%d %d", &n, &m);
for (int i = 1;i <= n;++i) {
int a, b;
scanf("%d %d", &a, &b);
for (int j = a;j <= b;++j) {
vis[j] = true;
}
}
int ans = 0;
for (int i = 1;i <= m;++i) {
if (vis[i] == false) {
ans_index[ans] = i;
ans++;
}
}
printf("%d\n", ans);
if (ans == 0) {
printf("\n");
}
else {
for (int i = 0;i < ans;++i) {
printf("%d ", ans_index[i]);
}
}
//system("pause");
return 0;
}