#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(), (a).end() int main() { cin.tie(nullptr); ll N, S; cin >> N >> S; ll d = N * (N + 1) / 2 - S; set s; for (ll i = N; i > 0; i--) { if (d >= i) { s.insert(i); d -= i; } } cout << N - s.size() << '\n'; rep(i, 1, N + 1) { if (!s.count(i)) cout << i << ' '; } cout << '\n'; }