#pragma warning (disable : 4996)
#pragma comment(linker, "/STACK:36777216")

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>
#include <deque>
#include <ctime>
#include <list>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define sqr(x) ((x) * (x))

const ll INF = 1e17 + 7;
const ll MOD = 1e9 + 7;

ll v_prod(pll a, pll b){
	return a.first * b.second - a.second * b.first;
}

pll operator - (pll a, pll b){
	return{ a.first - b.first, a.second - b.second };
}

bool operator == (pll a, pll b){
	return a.first == b.first && a.second == b.second;
}

ll d_dist(pll a, pll b){
	return sqr(a.first - b.first) + sqr(a.second - b.second);
}

ll sssgn(ll x){
	if (x < 0ll) return 0;
	return 1;
}

bool is_into(pll a, pll b, pll c, pll d){
	if (sssgn(v_prod(b - a, d - a)) == sssgn(v_prod(c - b, d - b)) &&
		sssgn(v_prod(b - a, d - a)) == sssgn(v_prod(a - c, d - c)))
		return true;
	if (v_prod(c - a, d - a) == 0ll && d_dist(d, a) < d_dist(c, a))
		return true;
	if (v_prod(c - b, d - b) == 0ll && d_dist(d, b) < d_dist(c, b))
		return true;
	return false;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(14);
#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen(CONTEST ".in", "r", stdin);
	//freopen(CONTEST ".out", "w", stdout);
#endif

	int n;
	cin >> n;
	vector<pair<ll, ll>> v;
	for (int i = 0; i < n; ++i){
		int x, y;
		cin >> x >> y;
		v.push_back({ x, y });
	}

	pair<ll, ll> a = v[0], b = v[1];
	int ia = 0, ib = 1, ic = 2;
	for (int i = 2; i < n; ++i){
		pll c = v[i];
		if (v_prod(c - a, b - a) == 0ll){
			if (d_dist(a, c) < d_dist(b, c)){
				b = c;
				ib = i;
			}
		}
	}
	pll c;
	for (int i = 0; i < n; ++i){
		c = v[i];
		ic = i;
		if (v_prod(b - a, c - a) != 0)
			break;
	}
	for (int i = 0; i < n; ++i){
		pll d = v[i];
		if (d == a || d == b || d == c)
			continue;
		if (is_into(a, b, c, d)){
			c = d;
			ic = i;
		}
	}
	cout << ia + 1 << ' ' << ib + 1 << ' ' << ic + 1 << endl;

	return 0;
};


#pragma warning (disable : 4996)
#pragma comment(linker, "/STACK:36777216")

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>
#include <deque>
#include <ctime>
#include <list>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define sqr(x) ((x) * (x))
#define sgn(x) (((x) > 0) ? 1 : 0)

const ll INF = 1e17 + 7;
const ll MOD = 1e9 + 7;

ll v_prod(pll &a, pll &b){
	return a.first * b.second - a.second * b.first;
}

pll operator - (pll& a, pll& b){
	return{ a.first - b.first, a.second - b.second };
}

bool operator == (pll a, pll b){
	return a.first == b.first && a.second == b.second;
}

ll d_dist(pll a, pll b){
	return sqr(a.first - b.first) + sqr(a.second - b.second);
}

bool is_into(pll a, pll b, pll c, pll d){
	if (sgn(v_prod(b - a, d - a)) == sgn(v_prod(c - b, d - b)) &&
		sgn(v_prod(b - a, d - a)) == sgn(v_prod(a - c, d - c)))
		return true;
	if (v_prod(c - a, d - a) == 0 && d_dist(d, a) < d_dist(c, a))
		return true;
	if (v_prod(c - a, d - b) == 0 && d_dist(d, b) < d_dist(c, b))
		return true;
	return false;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(14);
#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen(CONTEST ".in", "r", stdin);
	//freopen(CONTEST ".out", "w", stdout);
#endif

	int n;
	cin >> n;
	vector<pair<ll, ll>> v;
	for (int i = 0; i < n; ++i){
		int x, y;
		cin >> x >> y;
		v.push_back({ x, y });
	}

	pair<ll, ll> a = v[0], b = v[1];
	int ia = 0, ib = 1, ic = 2;
	for (int i = 2; i < n; ++i){
		pll c = v[i];
		if (v_prod(c - a, b - a) == 0ll){
			if (d_dist(a, c) < d_dist(b, c)){
				b = c;
				ib = i;
			}
		}
	}
	pll c;
	for (int i = 0; i < n; ++i){
		c = v[i];
		ic = i;
		if (v_prod(b - a, c - a) != 0)
			break;
	}
	for (int i = 0; i < n; ++i){
		pll d = v[i];
		if (d == a || d == b || d == c)
			continue;
		if (is_into(a, b, c, d)){
			c = d;
			ic = i;
		}
	}
	cout << ia + 1 << ' ' << ib + 1 << ' ' << ic + 1 << endl;

	return 0;
};


#pragma warning (disable : 4996)
#pragma comment(linker, "/STACK:36777216")

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>
#include <deque>
#include <ctime>
#include <list>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define sqr(x) ((x) * (x))

const ll INF = 1e17 + 7;
const ll MOD = 1e9 + 7;

ll v_prod(pll &a, pll &b){
	return a.first * b.second - a.second * b.first;
}

pll operator - (pll& a, pll& b){
	return{ a.first - b.first, a.second - b.second };
}

bool operator == (pll a, pll b){
	return a.first == b.first && a.second == b.second;
}

ll d_dist(pll a, pll b){
	return sqr(a.first - b.first) + sqr(a.second - b.second);
}

ll sssgn(ll x){
	if (x < 0ll) return 0;
	return 1;
}

bool is_into(pll a, pll b, pll c, pll d){
	/*if (sssgn(v_prod(b - a, d - a)) == sssgn(v_prod(c - b, d - b)) &&
		sssgn(v_prod(b - a, d - a)) == sssgn(v_prod(a - c, d - c)))
		return true;*/
	if (v_prod(c - a, d - a) == 0ll && d_dist(d, a) < d_dist(c, a))
		return true;
	if (v_prod(c - a, d - b) == 0ll && d_dist(d, b) < d_dist(c, b))
		return true;
	return false;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(14);
#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen(CONTEST ".in", "r", stdin);
	//freopen(CONTEST ".out", "w", stdout);
#endif

	int n;
	cin >> n;
	vector<pair<ll, ll>> v;
	for (int i = 0; i < n; ++i){
		int x, y;
		cin >> x >> y;
		v.push_back({ x, y });
	}

	pair<ll, ll> a = v[0], b = v[1];
	int ia = 0, ib = 1, ic = 2;
	for (int i = 2; i < n; ++i){
		pll c = v[i];
		if (v_prod(c - a, b - a) == 0ll){
			if (d_dist(a, c) < d_dist(b, c)){
				b = c;
				ib = i;
			}
		}
	}
	pll c;
	for (int i = 0; i < n; ++i){
		c = v[i];
		ic = i;
		if (v_prod(b - a, c - a) != 0)
			break;
	}
	for (int i = 0; i < n; ++i){
		pll d = v[i];
		if (d == a || d == b || d == c)
			continue;
		if (is_into(a, b, c, d)){
			c = d;
			ic = i;
		}
	}
	cout << ia + 1 << ' ' << ib + 1 << ' ' << ic + 1 << endl;

	return 0;
};


#pragma warning (disable : 4996)
#pragma comment(linker, "/STACK:36777216")

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>
#include <deque>
#include <ctime>
#include <list>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define sqr(x) ((x) * (x))

const ll INF = 1e17 + 7;
const ll MOD = 1e9 + 7;

ll v_prod(pll a, pll b){
	return a.first * b.second - a.second * b.first;
}

ll s_prod(pll a, pll b){
	return a.first * b.first + a.second * b.second;
}

pll operator - (pll a, pll b){
	return{ a.first - b.first, a.second - b.second };
}

bool operator == (pll a, pll b){
	return a.first == b.first && a.second == b.second;
}

ll d_dist(pll a, pll b){
	return sqr(a.first - b.first) + sqr(a.second - b.second);
}

ll sgn(ll x){
	if (x < 0ll) return 0;
	return 1;
}

bool is_into(pll a, pll b, pll c, pll d){
	if (sgn(v_prod(b - a, d - a)) == sgn(v_prod(c - b, d - b)) &&
		sgn(v_prod(b - a, d - a)) == sgn(v_prod(a - c, d - c)))
		return true;
	if (v_prod(c - a, d - a) == 0ll && d_dist(d, a) < d_dist(c, a) && s_prod(d - a, c - a) > 0)
		return true;
	if (v_prod(c - b, d - b) == 0ll && d_dist(d, b) < d_dist(c, b) && s_prod(d - b, c - b) > 0)
		return true;
	return false;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(14);
#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen(CONTEST ".in", "r", stdin);
	//freopen(CONTEST ".out", "w", stdout);
#endif

	int n;
	cin >> n;
	vector<pair<ll, ll>> v;
	for (int i = 0; i < n; ++i){
		int x, y;
		cin >> x >> y;
		v.push_back({ x, y });
	}

	pair<ll, ll> a = v[0], b = v[1];
	int ia = 0, ib = 1, ic = 2;
	for (int i = 2; i < n; ++i){
		pll c = v[i];
		if (v_prod(c - a, b - a) == 0ll){
			if (d_dist(a, c) < d_dist(b, c)){
				b = c;
				ib = i;
			}
		}
	}
	pll c;
	for (int i = 0; i < n; ++i){
		c = v[i];
		ic = i;
		if (v_prod(b - a, c - a) != 0)
			break;
	}
	for (int i = 0; i < n; ++i){
		pll d = v[i];
		if (d == a || d == b || d == c)
			continue;
		if (is_into(a, b, c, d)){
			c = d;
			ic = i;
		}
	}
	cout << ia + 1 << ' ' << ib + 1 << ' ' << ic + 1 << endl;

	return 0;
};


#pragma warning (disable : 4996)
#pragma comment(linker, "/STACK:36777216")

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>
#include <deque>
#include <ctime>
#include <list>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define sqr(x) ((x) * (x))

const ll INF = 1e17 + 7;
const ll MOD = 1e9 + 7;

ll v_prod(pll &a, pll &b){
	return a.first * b.second - a.second * b.first;
}

pll operator - (pll& a, pll& b){
	return{ a.first - b.first, a.second - b.second };
}

bool operator == (pll a, pll b){
	return a.first == b.first && a.second == b.second;
}

ll d_dist(pll a, pll b){
	return sqr(a.first - b.first) + sqr(a.second - b.second);
}

ll ssgn(ll x){
	if (x < 0) return 0;
	return 1;
}

bool is_into(pll a, pll b, pll c, pll d){
	if (ssgn(v_prod(b - a, d - a)) == ssgn(v_prod(c - b, d - b)) &&
		ssgn(v_prod(b - a, d - a)) == ssgn(v_prod(a - c, d - c)))
		return true;
	if (v_prod(c - a, d - a) == 0 && d_dist(d, a) < d_dist(c, a))
		return true;
	if (v_prod(c - a, d - b) == 0 && d_dist(d, b) < d_dist(c, b))
		return true;
	return false;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(14);
#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen(CONTEST ".in", "r", stdin);
	//freopen(CONTEST ".out", "w", stdout);
#endif

	int n;
	cin >> n;
	vector<pair<ll, ll>> v;
	for (int i = 0; i < n; ++i){
		int x, y;
		cin >> x >> y;
		v.push_back({ x, y });
	}

	pair<ll, ll> a = v[0], b = v[1];
	int ia = 0, ib = 1, ic = 2;
	for (int i = 2; i < n; ++i){
		pll c = v[i];
		if (v_prod(c - a, b - a) == 0ll){
			if (d_dist(a, c) < d_dist(b, c)){
				b = c;
				ib = i;
			}
		}
	}
	pll c;
	for (int i = 0; i < n; ++i){
		c = v[i];
		ic = i;
		if (v_prod(b - a, c - a) != 0)
			break;
	}
	for (int i = 0; i < n; ++i){
		pll d = v[i];
		if (d == a || d == b || d == c)
			continue;
		if (is_into(a, b, c, d)){
			c = d;
			ic = i;
		}
	}
	cout << ia + 1 << ' ' << ib + 1 << ' ' << ic + 1 << endl;

	return 0;
};


#pragma warning (disable : 4996)
#pragma comment(linker, "/STACK:36777216")

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>
#include <deque>
#include <ctime>
#include <list>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define sqr(x) ((x) * (x))

const ll INF = 1e17 + 7;
const ll MOD = 1e9 + 7;

ll v_prod(pll a, pll b){
	return a.first * b.second - a.second * b.first;
}

pll operator - (pll a, pll b){
	return{ a.first - b.first, a.second - b.second };
}

bool operator == (pll a, pll b){
	return a.first == b.first && a.second == b.second;
}

ll d_dist(pll a, pll b){
	return sqr(a.first - b.first) + sqr(a.second - b.second);
}

ll sgn(ll x){
	if (x < 0ll) return 0;
	return 1;
}

bool is_into(pll a, pll b, pll c, pll d){
	if (sgn(v_prod(b - a, d - a)) == sgn(v_prod(c - b, d - b)) &&
		sgn(v_prod(b - a, d - a)) == sgn(v_prod(a - c, d - c)))
		return true;
	if (v_prod(c - a, d - a) == 0ll && d_dist(d, a) < d_dist(c, a) && d_dist(a, d) + d_dist(d, c) == d_dist(a, c))
		return true;
	if (v_prod(c - b, d - b) == 0ll && d_dist(d, b) < d_dist(c, b) && d_dist(b, d) + d_dist(d, c) == d_dist(b, c))
		return true;
	return false;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(14);
#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen(CONTEST ".in", "r", stdin);
	//freopen(CONTEST ".out", "w", stdout);
#endif

	int n;
	cin >> n;
	vector<pair<ll, ll>> v;
	for (int i = 0; i < n; ++i){
		int x, y;
		cin >> x >> y;
		v.push_back({ x, y });
	}

	pair<ll, ll> a = v[0], b = v[1];
	int ia = 0, ib = 1, ic = 2;
	for (int i = 2; i < n; ++i){
		pll c = v[i];
		if (v_prod(c - a, b - a) == 0ll){
			if (d_dist(a, c) < d_dist(b, c)){
				b = c;
				ib = i;
			}
		}
	}
	pll c;
	for (int i = 0; i < n; ++i){
		c = v[i];
		ic = i;
		if (v_prod(b - a, c - a) != 0)
			break;
	}
	for (int i = 0; i < n; ++i){
		pll d = v[i];
		if (d == a || d == b || d == c)
			continue;
		if (is_into(a, b, c, d)){
			c = d;
			ic = i;
		}
	}
	cout << ia + 1 << ' ' << ib + 1 << ' ' << ic + 1 << endl;

	return 0;
};


#pragma warning (disable : 4996)
#pragma comment(linker, "/STACK:36777216")

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>
#include <deque>
#include <ctime>
#include <list>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define sqr(x) ((x) * (x))

const ll INF = 1e17 + 7;
const ll MOD = 1e9 + 7;

ll v_prod(pll &a, pll &b){
	return a.first * b.second - a.second * b.first;
}

pll operator - (pll& a, pll& b){
	return{ a.first - b.first, a.second - b.second };
}

bool operator == (pll a, pll b){
	return a.first == b.first && a.second == b.second;
}

ll d_dist(pll a, pll b){
	return sqr(a.first - b.first) + sqr(a.second - b.second);
}

ll sssgn(ll x){
	if (x < 0) return 0;
	return 1;
}

bool is_into(pll a, pll b, pll c, pll d){
	/*if (sssgn(v_prod(b - a, d - a)) == sssgn(v_prod(c - b, d - b)) &&
		sssgn(v_prod(b - a, d - a)) == sssgn(v_prod(a - c, d - c)))
		return true;*/
	if (v_prod(c - a, d - a) == 0 && d_dist(d, a) < d_dist(c, a))
		return true;
	if (v_prod(c - a, d - b) == 0 && d_dist(d, b) < d_dist(c, b))
		return true;
	return false;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(14);
#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen(CONTEST ".in", "r", stdin);
	//freopen(CONTEST ".out", "w", stdout);
#endif

	int n;
	cin >> n;
	vector<pair<ll, ll>> v;
	for (int i = 0; i < n; ++i){
		int x, y;
		cin >> x >> y;
		v.push_back({ x, y });
	}

	pair<ll, ll> a = v[0], b = v[1];
	int ia = 0, ib = 1, ic = 2;
	for (int i = 2; i < n; ++i){
		pll c = v[i];
		if (v_prod(c - a, b - a) == 0ll){
			if (d_dist(a, c) < d_dist(b, c)){
				b = c;
				ib = i;
			}
		}
	}
	pll c;
	for (int i = 0; i < n; ++i){
		c = v[i];
		ic = i;
		if (v_prod(b - a, c - a) != 0)
			break;
	}
	for (int i = 0; i < n; ++i){
		pll d = v[i];
		if (d == a || d == b || d == c)
			continue;
		if (is_into(a, b, c, d)){
			c = d;
			ic = i;
		}
	}
	cout << ia + 1 << ' ' << ib + 1 << ' ' << ic + 1 << endl;

	return 0;
};


#pragma warning (disable : 4996)
#pragma comment(linker, "/STACK:36777216")

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>
#include <deque>
#include <ctime>
#include <list>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define sqr(x) ((x) * (x))

const ll INF = 1e17 + 7;
const ll MOD = 1e9 + 7;

ll v_prod(pll a, pll b){
	return a.first * b.second - a.second * b.first;
}

ll s_prod(pll a, pll b){
	return a.first * b.first + a.second * b.second;
}

pll operator - (pll a, pll b){
	return{ a.first - b.first, a.second - b.second };
}

bool operator == (pll a, pll b){
	return a.first == b.first && a.second == b.second;
}

ll d_dist(pll a, pll b){
	return sqr(a.first - b.first) + sqr(a.second - b.second);
}

ll sgn(ll x){
	if (x < 0ll) return 0;
	return 1;
}

bool is_into(pll a, pll b, pll c, pll d){
	if (sgn(v_prod(b - a, d - a)) == sgn(v_prod(c - b, d - b)) &&
		sgn(v_prod(b - a, d - a)) == sgn(v_prod(a - c, d - c)))
		return true;
	if (v_prod(c - a, d - a) == 0ll && d_dist(d, a) < d_dist(c, a) && s_prod(d - a, c - a) > 0)
		return true;
	if (v_prod(c - b, d - b) == 0ll && d_dist(d, b) < d_dist(c, b) && s_prod(d - b, c - b) > 0)
		return true;
	return false;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(14);
#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen(CONTEST ".in", "r", stdin);
	//freopen(CONTEST ".out", "w", stdout);
#endif

	int n;
	cin >> n;
	vector<pair<ll, ll>> v;
	for (int i = 0; i < n; ++i){
		int x, y;
		cin >> x >> y;
		v.push_back({ x, y });
	}

	pair<ll, ll> a = v[0], b = v[1];
	int ia = 0, ib = 1, ic = 2;
	for (int i = 2; i < n; ++i){
		pll c = v[i];
		if (v_prod(c - a, b - a) == 0ll){
			if (d_dist(a, c) < d_dist(a, b)){
				b = c;
				ib = i;
			}
		}
	}
	pll c;
	for (int i = 0; i < n; ++i){
		c = v[i];
		ic = i;
		if (v_prod(b - a, c - a) != 0)
			break;
	}
	for (int i = 0; i < n; ++i){
		pll d = v[i];
		if (d == a || d == b || d == c)
			continue;
		if (is_into(a, b, c, d)){
			c = d;
			ic = i;
		}
	}
	cout << ia + 1 << ' ' << ib + 1 << ' ' << ic + 1 << endl;

	return 0;
};


#pragma warning (disable : 4996)
#pragma comment(linker, "/STACK:36777216")

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>
#include <deque>
#include <ctime>
#include <list>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define sqr(x) ((x) * (x))

const ll INF = 1e17 + 7;
const ll MOD = 1e9 + 7;

ll v_prod(pll a, pll b){
	return a.first * b.second - a.second * b.first;
}

pll operator - (pll a, pll b){
	return{ a.first - b.first, a.second - b.second };
}

bool operator == (pll a, pll b){
	return a.first == b.first && a.second == b.second;
}

ll d_dist(pll a, pll b){
	return sqr(a.first - b.first) + sqr(a.second - b.second);
}

ll sssgn(ll x){
	if (x < 0ll) return 0;
	return 1;
}

bool is_into(pll a, pll b, pll c, pll d){
	/*if (sssgn(v_prod(b - a, d - a)) == sssgn(v_prod(c - b, d - b)) &&
		sssgn(v_prod(b - a, d - a)) == sssgn(v_prod(a - c, d - c)))
		return true;*/
	if (v_prod(c - a, d - a) == 0ll && d_dist(d, a) < d_dist(c, a))
		return true;
	if (v_prod(c - a, d - b) == 0ll && d_dist(d, b) < d_dist(c, b))
		return true;
	return false;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(14);
#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen(CONTEST ".in", "r", stdin);
	//freopen(CONTEST ".out", "w", stdout);
#endif

	int n;
	cin >> n;
	vector<pair<ll, ll>> v;
	for (int i = 0; i < n; ++i){
		int x, y;
		cin >> x >> y;
		v.push_back({ x, y });
	}

	pair<ll, ll> a = v[0], b = v[1];
	int ia = 0, ib = 1, ic = 2;
	for (int i = 2; i < n; ++i){
		pll c = v[i];
		if (v_prod(c - a, b - a) == 0ll){
			if (d_dist(a, c) < d_dist(b, c)){
				b = c;
				ib = i;
			}
		}
	}
	pll c;
	for (int i = 0; i < n; ++i){
		c = v[i];
		ic = i;
		if (v_prod(b - a, c - a) != 0)
			break;
	}
	for (int i = 0; i < n; ++i){
		pll d = v[i];
		if (d == a || d == b || d == c)
			continue;
		if (is_into(a, b, c, d)){
			c = d;
			ic = i;
		}
	}
	cout << ia + 1 << ' ' << ib + 1 << ' ' << ic + 1 << endl;

	return 0;
};


import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import java.lang.String;

import static java.lang.Math.*;

public class Main {
    long mod = (long) 1e9 + 7;

    void run() throws IOException {
        long a = nextInt();
        long b = nextInt();
        long x = 1;
        while ((x * (x + 1)) / 2 <= a + b) x++;
        x--;
        int[] take = new int[(int) x + 1];
        if (a > b) {
            long t = a;
            a = b;
            b = t;
        }
        long e = b;
        long minus = x;
        int count = 0;
        while (e - minus >= 0 && minus > 0) {
            e -= minus;
            take[(int) minus] = 1;
            minus--;
            count++;
        }
        if (e != 0 && e <= minus) count++;
        take[(int) e] = 1;
        pw.println(x - count);
        for (int i = 1; i < take.length; i++) {
            if (take[i] == 0) pw.print(i + " ");
        }
        if (x - count != 0)
            pw.println();
        pw.println(count);
        for (int i = 1; i < take.length; i++) {
            if (take[i] == 1) pw.print(i + " ");
        }
        pw.close();
    }

    class Point {
        long x;
        int y;

        public Point(long a, int b) {
            x = a;
            y = b;
        }
    }

    class PointComp implements Comparator<Point> {

        @Override
        public int compare(Point o1, Point o2) {
            if (o1.x == o2.x) return Integer.compare(o1.y, o2.y);
            return Long.compare(o1.x, o2.x);
        }
    }

    class Tuple {
        int from, to;
        long ves;

        public Tuple(int a, int b, long c) {
            from = a;
            to = b;
            ves = c;
        }
    }

    class TupleComp implements Comparator<Tuple> {

        @Override
        public int compare(Tuple o1, Tuple o2) {
            if (o1.ves == o2.ves && o1.to == o2.to) return Integer.compare(o1.from, o2.from);
            if (o1.ves == o2.ves) return Integer.compare(o1.to, o2.to);
            return Long.compare(o1.ves, o2.ves);
        }
    }

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    PrintWriter pw = new PrintWriter(System.out);

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    String next() throws IOException {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public Main() throws FileNotFoundException {
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

}


import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import java.lang.String;

import static java.lang.Math.*;

public class Main {
    long mod = (long) 1e9 + 7;

    void run() throws IOException {
        long a = nextInt();
        long b = nextInt();
        long x = 1;
        while ((x * (x + 1)) / 2 <= a + b) x++;
        x--;
        int[] take = new int[(int) x + 1];
        if (a > b) {
            long t = a;
            a = b;
            b = t;
        }
        long e = b;
        long minus = x;
        int count = 0;
        while (e - minus >= 0 && minus > 0) {
            e -= minus;
            take[(int) minus]++;
            minus--;
            count++;
        }
        if (e != 0) count++;
        take[(int) e]++;
        pw.println(x - count);
        for (int i = 1; i < take.length; i++) {
            if (take[i] == 0) pw.print(i + " ");
        }
        if (x - count != 0)
            pw.println();
        pw.println(count);
        for (int i = 1; i < take.length; i++) {
            if (take[i] == 1) pw.print(i + " ");
        }
        pw.close();
    }

    class Point {
        long x;
        int y;

        public Point(long a, int b) {
            x = a;
            y = b;
        }
    }

    class PointComp implements Comparator<Point> {

        @Override
        public int compare(Point o1, Point o2) {
            if (o1.x == o2.x) return Integer.compare(o1.y, o2.y);
            return Long.compare(o1.x, o2.x);
        }
    }

    class Tuple {
        int from, to;
        long ves;

        public Tuple(int a, int b, long c) {
            from = a;
            to = b;
            ves = c;
        }
    }

    class TupleComp implements Comparator<Tuple> {

        @Override
        public int compare(Tuple o1, Tuple o2) {
            if (o1.ves == o2.ves && o1.to == o2.to) return Integer.compare(o1.from, o2.from);
            if (o1.ves == o2.ves) return Integer.compare(o1.to, o2.to);
            return Long.compare(o1.ves, o2.ves);
        }
    }

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    PrintWriter pw = new PrintWriter(System.out);

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    String next() throws IOException {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public Main() throws FileNotFoundException {
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

}


import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import java.lang.String;

import static java.lang.Math.*;

public class Main {
    long mod = (long) 1e9 + 7;

    void run() throws IOException {
        long a = nextInt();
        long b = nextInt();
        long x = 1;
        while ((x * (x + 1)) / 2 <= a + b) x++;
        x--;
        int[] take = new int[(int) x + 1];
        boolean yes = false;
        if (a > b) {
            yes = true;
            long t = a;
            a = b;
            b = t;
        }
        long e = b;
        long minus = x;
        int count = 0;
        while (e - minus >= 0 && minus > 0) {
            e -= minus;
            take[(int) minus] = 1;
            minus--;
            count++;
        }
        if (e != 0 && e <= minus) count++;
        take[(int) e] = 1;
        if(!yes) {
            pw.println(x - count);
            for (int i = 1; i < take.length; i++) {
                if (take[i] == 0) pw.print(i + " ");
            }
            if (x - count != 0)
                pw.println();
            pw.println(count);
            for (int i = 1; i < take.length; i++) {
                if (take[i] == 1) pw.print(i + " ");
            }
        }
        else {
            pw.println(count);
            for (int i = 1; i < take.length; i++) {
                if (take[i] == 1) pw.print(i + " ");
            }
            if (x - count != 0)
                pw.println();
            pw.println(x - count);
            for (int i = 1; i < take.length; i++) {
                if (take[i] == 0) pw.print(i + " ");
            }

        }
        pw.close();
    }

    class Point {
        long x;
        int y;

        public Point(long a, int b) {
            x = a;
            y = b;
        }
    }

    class PointComp implements Comparator<Point> {

        @Override
        public int compare(Point o1, Point o2) {
            if (o1.x == o2.x) return Integer.compare(o1.y, o2.y);
            return Long.compare(o1.x, o2.x);
        }
    }

    class Tuple {
        int from, to;
        long ves;

        public Tuple(int a, int b, long c) {
            from = a;
            to = b;
            ves = c;
        }
    }

    class TupleComp implements Comparator<Tuple> {

        @Override
        public int compare(Tuple o1, Tuple o2) {
            if (o1.ves == o2.ves && o1.to == o2.to) return Integer.compare(o1.from, o2.from);
            if (o1.ves == o2.ves) return Integer.compare(o1.to, o2.to);
            return Long.compare(o1.ves, o2.ves);
        }
    }

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    PrintWriter pw = new PrintWriter(System.out);

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    String next() throws IOException {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public Main() throws FileNotFoundException {
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

}


import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import java.lang.String;

import static java.lang.Math.*;

public class Main {
    long mod = (long) 1e9 + 7;

    void run() throws IOException {
        long a = nextInt();
        long b = nextInt();
        long x = 1;
        while (x * (x + 1) / 2 <= a + b) x++;
        x--;
        int[] take = new int[(int) x + 1];
        if (a > b) {
            long t = a;
            a = b;
            b = t;
        }
        long e = b;
        long minus = x;
        int count = 0;
        while (e - minus >= 0) {
            e -= minus;
            take[(int) minus]++;
            minus--;
            count++;
        }
        if (e != 0) count++;
        take[(int) e]++;
        pw.println(x - count);
        for (int i = 1; i < take.length; i++) {
            if(take[i] == 0)pw.print(i + " ");
        }
        pw.println();
        pw.println(count);
        for (int i = 1; i < take.length; i++) {
            if(take[i] == 1)pw.print(i + " ");
        }
        pw.close();
    }

    class Point {
        long x;
        int y;

        public Point(long a, int b) {
            x = a;
            y = b;
        }
    }

    class PointComp implements Comparator<Point> {

        @Override
        public int compare(Point o1, Point o2) {
            if (o1.x == o2.x) return Integer.compare(o1.y, o2.y);
            return Long.compare(o1.x, o2.x);
        }
    }

    class Tuple {
        int from, to;
        long ves;

        public Tuple(int a, int b, long c) {
            from = a;
            to = b;
            ves = c;
        }
    }

    class TupleComp implements Comparator<Tuple> {

        @Override
        public int compare(Tuple o1, Tuple o2) {
            if (o1.ves == o2.ves && o1.to == o2.to) return Integer.compare(o1.from, o2.from);
            if (o1.ves == o2.ves) return Integer.compare(o1.to, o2.to);
            return Long.compare(o1.ves, o2.ves);
        }
    }

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    PrintWriter pw = new PrintWriter(System.out);

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    String next() throws IOException {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public Main() throws FileNotFoundException {
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define ll                 long long
#define ra                 return a;
#define pb                 push_back
#define sti                stack<ll>
#define spi                stack<pair<ll,ll>>
#define S                  second
#define msi                map<string,ll >
#define msi                map<string,ll >
#define mii                map<ll ,ll >
#define dbg(x)             { cerr<<#x<<": "<<x<< endl; }
#define dbg2(x,y)          { cerr<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl; }
#define dbg3(x,y,z)        { cerr<<#x<<": "<<x<<" , "<<#y<<": "<<y<<" , "<<#z<<": "<<z<<endl; }
#define mis                map<ll , string>
#define rep(i,a,b)         for(ll  i=a;i<b;i++)
#define mpi                map<pair<ll ,ll >,ll >
#define pii                pair<ll ,ll >
#define ppb                pop_back
#define F                  first
#define vi                 vector<ll >
#define vii                vector<pair<ll , ll> >
#define si                 set <ll>
#define vs                 vector<string>
#define all(a)             (a).begin(),(a).end()
#define sz(x)              (ll )x.size()
#define hell               1000000000000
#define bs                 binary_search
#define mp                 make_pair
#define qi                 queue<ll>
#define qs                 queue<string>
#define qpi                queue<pair<ll,ll> >
#define qps                queue<pair<ll,string>>
#define endl               '\n'
#define itr(a,it)          for(typeof(a.begin()) it=a.begin();it!=a.end();it++)// This will produce const_iterator for const object and normal iterator for non-const object
#define ss                 set<string>
using namespace std;
#define U 998244353
#define N  300005
#define inf         1000000000000000
#define mod            1000000007
#define unique(v) v.erase(unique(v.begin(),v.end()),v.end())

typedef tree<pii,null_type,less<pii>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
//ll a[N];
//ll dp[N],dp1[N];
//set<ll>s[N];
//vi adj[100005];
//vi v[N];
//set<ll>s1[26],s2;
//ll int a[N],b[N];
//set<ll>adj[N];
//ll int vis[N];
//void initialize()
//{
 //rep(i,0,1005)
//{
  //  vis[i]=0;
//}
//}
//sti st;
//bool vis[N];
//void dfs(ll node)
//{
//if(vis[node]==1)
 //{
  //   return;
 //}
 //vis[node]=1;
 //m2[node]=sz(v);
//set<ll>::iterator it=adj[node].begin();
//for(ll i=0;i<sz(adj[node]);i++)
//for(auto it:adj[node])
 //{
  //if(!vis[it])
  //{
   //dfs(it,dist+1,node);
   //m1[node]+=m1[it];
   //m2[node]+=m2[it];
     //m1[node]=sz(v);
  // }
  //}
//}
//ll fast_pow(ll b, ll n,ll MOD)
//{
  //  if(n==0)
    //   return 1;
    //if(n==1)
    //return b;
    //ll h=fast_pow(b,n/2,mod);
    //if(n%2==0)
      //  return ( h * h ) % mod;
    //else
      //  return ( ( ( h * h ) % mod ) * b ) % mod;
//}
//set<pair<ll,ll>>s[N];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie();
    cout.tie(0);
   //freopen("input.txt", "r", stdin);
   // freopen("output1.txt", "w", stdout);
   ll n,m,p=0,q=0,l=0,i,t,flag=0,k,j,r=0,curr=0,d;
   cin>>n>>m;
   p=n+m;
   j=int(sqrt(1+8*p));
   j--;
   j/=2;
   mii m1;
   vi v,v1;
   if(n!=0)
   {
   for(i=j;i>=1;i--)
   {
    if(i<=n)
    {
      v.pb(i);
      m1[i]=1;
      n-=i;
    }
   }
   }
   if(m!=0)
   {
  for(i=j;i>=1;i--)
  {
    if(m1[i]==0)
    {
    v1.pb(i);
     }
  }
  }
 cout<<sz(v)<<endl;
 rep(i,0,sz(v))
 {
  cout<<v[i]<<" ";
 }
 cout<<endl;
 cout<<sz(v1)<<endl;
 rep(i,0,sz(v1))
 {
  cout<<v1[i]<<" ";
 }

return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define ll                 long long
#define ra                 return a;
#define pb                 push_back
#define sti                stack<ll>
#define spi                stack<pair<ll,ll>>
#define S                  second
#define msi                map<string,ll >
#define msi                map<string,ll >
#define mii                map<ll ,ll >
#define dbg(x)             { cerr<<#x<<": "<<x<< endl; }
#define dbg2(x,y)          { cerr<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl; }
#define dbg3(x,y,z)        { cerr<<#x<<": "<<x<<" , "<<#y<<": "<<y<<" , "<<#z<<": "<<z<<endl; }
#define mis                map<ll , string>
#define rep(i,a,b)         for(ll  i=a;i<b;i++)
#define mpi                map<pair<ll ,ll >,ll >
#define pii                pair<ll ,ll >
#define ppb                pop_back
#define F                  first
#define vi                 vector<ll >
#define vii                vector<pair<ll , ll> >
#define si                 set <ll>
#define vs                 vector<string>
#define all(a)             (a).begin(),(a).end()
#define sz(x)              (ll )x.size()
#define hell               1000000000000
#define bs                 binary_search
#define mp                 make_pair
#define qi                 queue<ll>
#define qs                 queue<string>
#define qpi                queue<pair<ll,ll> >
#define qps                queue<pair<ll,string>>
#define endl               '\n'
#define itr(a,it)          for(typeof(a.begin()) it=a.begin();it!=a.end();it++)// This will produce const_iterator for const object and normal iterator for non-const object
#define ss                 set<string>
using namespace std;
#define U 998244353
#define N  300005
#define inf         1000000000000000
#define mod            1000000007
#define unique(v) v.erase(unique(v.begin(),v.end()),v.end())

typedef tree<pii,null_type,less<pii>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
//ll a[N];
//ll dp[N],dp1[N];
//set<ll>s[N];
//vi adj[100005];
//vi v[N];
//set<ll>s1[26],s2;
//ll int a[N],b[N];
//set<ll>adj[N];
//ll int vis[N];
//void initialize()
//{
 //rep(i,0,1005)
//{
  //  vis[i]=0;
//}
//}
//sti st;
//bool vis[N];
//void dfs(ll node)
//{
//if(vis[node]==1)
 //{
  //   return;
 //}
 //vis[node]=1;
 //m2[node]=sz(v);
//set<ll>::iterator it=adj[node].begin();
//for(ll i=0;i<sz(adj[node]);i++)
//for(auto it:adj[node])
 //{
  //if(!vis[it])
  //{
   //dfs(it,dist+1,node);
   //m1[node]+=m1[it];
   //m2[node]+=m2[it];
     //m1[node]=sz(v);
  // }
  //}
//}
//ll fast_pow(ll b, ll n,ll MOD)
//{
  //  if(n==0)
    //   return 1;
    //if(n==1)
    //return b;
    //ll h=fast_pow(b,n/2,mod);
    //if(n%2==0)
      //  return ( h * h ) % mod;
    //else
      //  return ( ( ( h * h ) % mod ) * b ) % mod;
//}
//set<pair<ll,ll>>s[N];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie();
    cout.tie(0);
   //freopen("input.txt", "r", stdin);
   // freopen("output1.txt", "w", stdout);
   ll n,m,p=0,q=0,l=0,i,t,flag=0,k,j,r=0,curr=0,d;
   cin>>n>>m;
   p=n+m;
   j=int(sqrt(1+8*p));
   j--;
   j/=2;
   mii m1;
   vi v,v1;
   if(n>m)
   {
    flag=1;
    swap(n,m);
   }
   if(n!=0)
   {
   rep(l,1,j+1)
   {
    if(n-curr<=j&&m1[n-curr]==0)
    {
      v.pb(n-curr);
      m1[n-curr]=1;
      break;
    }
    else
    {
      curr+=l;
      v.pb(l);
      m1[l]=1;
    }
   }
   }
  rep(l,1,j+1)
  {
    if(m1[l]==0&&q<m)
    {
      q+=l;
    v1.pb(l);
     }
  }
  if(flag==0)
  {
 cout<<sz(v)<<endl;
 rep(i,0,sz(v))
 {
  cout<<v[i]<<" ";
 }
 cout<<endl;
 cout<<sz(v1)<<endl;
 rep(i,0,sz(v1))
 {
  cout<<v1[i]<<" ";
 }
}
else
{
  cout<<sz(v1)<<endl;
 rep(i,0,sz(v1))
 {
  cout<<v1[i]<<" ";
 }
 cout<<endl;
 cout<<sz(v)<<endl;
 rep(i,0,sz(v))
 {
  cout<<v[i]<<" ";
 }
}

return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define ll                 long long
#define ra                 return a;
#define pb                 push_back
#define sti                stack<ll>
#define spi                stack<pair<ll,ll>>
#define S                  second
#define msi                map<string,ll >
#define msi                map<string,ll >
#define mii                map<ll ,ll >
#define dbg(x)             { cerr<<#x<<": "<<x<< endl; }
#define dbg2(x,y)          { cerr<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl; }
#define dbg3(x,y,z)        { cerr<<#x<<": "<<x<<" , "<<#y<<": "<<y<<" , "<<#z<<": "<<z<<endl; }
#define mis                map<ll , string>
#define rep(i,a,b)         for(ll  i=a;i<b;i++)
#define mpi                map<pair<ll ,ll >,ll >
#define pii                pair<ll ,ll >
#define ppb                pop_back
#define F                  first
#define vi                 vector<ll >
#define vii                vector<pair<ll , ll> >
#define si                 set <ll>
#define vs                 vector<string>
#define all(a)             (a).begin(),(a).end()
#define sz(x)              (ll )x.size()
#define hell               1000000000000
#define bs                 binary_search
#define mp                 make_pair
#define qi                 queue<ll>
#define qs                 queue<string>
#define qpi                queue<pair<ll,ll> >
#define qps                queue<pair<ll,string>>
#define endl               '\n'
#define itr(a,it)          for(typeof(a.begin()) it=a.begin();it!=a.end();it++)// This will produce const_iterator for const object and normal iterator for non-const object
#define ss                 set<string>
using namespace std;
#define U 998244353
#define N  300005
#define inf         1000000000000000
#define mod            1000000007
#define unique(v) v.erase(unique(v.begin(),v.end()),v.end())

typedef tree<pii,null_type,less<pii>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
//ll a[N];
//ll dp[N],dp1[N];
//set<ll>s[N];
//vi adj[100005];
//vi v[N];
//set<ll>s1[26],s2;
//ll int a[N],b[N];
//set<ll>adj[N];
//ll int vis[N];
//void initialize()
//{
 //rep(i,0,1005)
//{
  //  vis[i]=0;
//}
//}
//sti st;
//bool vis[N];
//void dfs(ll node)
//{
//if(vis[node]==1)
 //{
  //   return;
 //}
 //vis[node]=1;
 //m2[node]=sz(v);
//set<ll>::iterator it=adj[node].begin();
//for(ll i=0;i<sz(adj[node]);i++)
//for(auto it:adj[node])
 //{
  //if(!vis[it])
  //{
   //dfs(it,dist+1,node);
   //m1[node]+=m1[it];
   //m2[node]+=m2[it];
     //m1[node]=sz(v);
  // }
  //}
//}
//ll fast_pow(ll b, ll n,ll MOD)
//{
  //  if(n==0)
    //   return 1;
    //if(n==1)
    //return b;
    //ll h=fast_pow(b,n/2,mod);
    //if(n%2==0)
      //  return ( h * h ) % mod;
    //else
      //  return ( ( ( h * h ) % mod ) * b ) % mod;
//}
//set<pair<ll,ll>>s[N];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie();
    cout.tie(0);
   //freopen("input.txt", "r", stdin);
   // freopen("output1.txt", "w", stdout);
   ll n,m,p=0,q=0,l=0,i,t,flag=0,k,j,r=0,curr=0,d;
   cin>>n>>m;
   p=n+m;
   j=int(sqrt(1+8*p));
   j--;
   j/=2;
   mii m1;
   vi v,v1;
   if(n>m)
   {
    swap(n,m);
   }
   rep(l,1,j+1)
   {
    if(n-curr<=j)
    {
      v.pb(n-curr);
      m1[n-curr]=1;
      break;
    }
    else
    {
      curr+=l;
      v.pb(l);
      m1[l]=1;
    }
   }
  rep(l,1,j+1)
  {
    if(m1[l]==0&&q<m)
    {
      q+=l;
    v1.pb(l);
     }
  }
 cout<<sz(v)<<endl;
 rep(i,0,sz(v))
 {
  cout<<v[i]<<" ";
 }
 cout<<endl;
 cout<<sz(v1)<<endl;
 rep(i,0,sz(v1))
 {
  cout<<v1[i]<<" ";
 }

return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define ll                 long long
#define ra                 return a;
#define pb                 push_back
#define sti                stack<ll>
#define spi                stack<pair<ll,ll>>
#define S                  second
#define msi                map<string,ll >
#define msi                map<string,ll >
#define mii                map<ll ,ll >
#define dbg(x)             { cerr<<#x<<": "<<x<< endl; }
#define dbg2(x,y)          { cerr<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl; }
#define dbg3(x,y,z)        { cerr<<#x<<": "<<x<<" , "<<#y<<": "<<y<<" , "<<#z<<": "<<z<<endl; }
#define mis                map<ll , string>
#define rep(i,a,b)         for(ll  i=a;i<b;i++)
#define mpi                map<pair<ll ,ll >,ll >
#define pii                pair<ll ,ll >
#define ppb                pop_back
#define F                  first
#define vi                 vector<ll >
#define vii                vector<pair<ll , ll> >
#define si                 set <ll>
#define vs                 vector<string>
#define all(a)             (a).begin(),(a).end()
#define sz(x)              (ll )x.size()
#define hell               1000000000000
#define bs                 binary_search
#define mp                 make_pair
#define qi                 queue<ll>
#define qs                 queue<string>
#define qpi                queue<pair<ll,ll> >
#define qps                queue<pair<ll,string>>
#define endl               '\n'
#define itr(a,it)          for(typeof(a.begin()) it=a.begin();it!=a.end();it++)// This will produce const_iterator for const object and normal iterator for non-const object
#define ss                 set<string>
using namespace std;
#define U 998244353
#define N  300005
#define inf         1000000000000000
#define mod            1000000007
#define unique(v) v.erase(unique(v.begin(),v.end()),v.end())

typedef tree<pii,null_type,less<pii>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
//ll a[N];
//ll dp[N],dp1[N];
//set<ll>s[N];
//vi adj[100005];
//vi v[N];
//set<ll>s1[26],s2;
//ll int a[N],b[N];
//set<ll>adj[N];
//ll int vis[N];
//void initialize()
//{
 //rep(i,0,1005)
//{
  //  vis[i]=0;
//}
//}
//sti st;
//bool vis[N];
//void dfs(ll node)
//{
//if(vis[node]==1)
 //{
  //   return;
 //}
 //vis[node]=1;
 //m2[node]=sz(v);
//set<ll>::iterator it=adj[node].begin();
//for(ll i=0;i<sz(adj[node]);i++)
//for(auto it:adj[node])
 //{
  //if(!vis[it])
  //{
   //dfs(it,dist+1,node);
   //m1[node]+=m1[it];
   //m2[node]+=m2[it];
     //m1[node]=sz(v);
  // }
  //}
//}
//ll fast_pow(ll b, ll n,ll MOD)
//{
  //  if(n==0)
    //   return 1;
    //if(n==1)
    //return b;
    //ll h=fast_pow(b,n/2,mod);
    //if(n%2==0)
      //  return ( h * h ) % mod;
    //else
      //  return ( ( ( h * h ) % mod ) * b ) % mod;
//}
//set<pair<ll,ll>>s[N];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie();
    cout.tie(0);
   //freopen("input.txt", "r", stdin);
   // freopen("output1.txt", "w", stdout);
   ll n,m,p=0,q=0,l=0,i,t,flag=0,k,j,r=0,curr=0,d;
   cin>>n>>m;
   p=n+m;
   j=int(sqrt(1+8*p));
   j--;
   j/=2;
   mii m1;
   vi v,v1;
   if(n>m)
   {
    flag=1;
    swap(n,m);
   }
   if(n!=0)
   {
   rep(l,1,j+1)
   {
    if(n-curr<=j)
    {
      v.pb(n-curr);
      m1[n-curr]=1;
      break;
    }
    else
    {
      curr+=l;
      v.pb(l);
      m1[l]=1;
    }
   }
   }
  rep(l,1,j+1)
  {
    if(m1[l]==0&&q<m)
    {
      q+=l;
    v1.pb(l);
     }
  }
  if(flag==0)
  {
 cout<<sz(v)<<endl;
 rep(i,0,sz(v))
 {
  cout<<v[i]<<" ";
 }
 cout<<endl;
 cout<<sz(v1)<<endl;
 rep(i,0,sz(v1))
 {
  cout<<v1[i]<<" ";
 }
}
else
{
  cout<<sz(v1)<<endl;
 rep(i,0,sz(v1))
 {
  cout<<v1[i]<<" ";
 }
 cout<<endl;
 cout<<sz(v)<<endl;
 rep(i,0,sz(v))
 {
  cout<<v[i]<<" ";
 }
}

return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define ll                 long long
#define ra                 return a;
#define pb                 push_back
#define sti                stack<ll>
#define spi                stack<pair<ll,ll>>
#define S                  second
#define msi                map<string,ll >
#define msi                map<string,ll >
#define mii                map<ll ,ll >
#define dbg(x)             { cerr<<#x<<": "<<x<< endl; }
#define dbg2(x,y)          { cerr<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl; }
#define dbg3(x,y,z)        { cerr<<#x<<": "<<x<<" , "<<#y<<": "<<y<<" , "<<#z<<": "<<z<<endl; }
#define mis                map<ll , string>
#define rep(i,a,b)         for(ll  i=a;i<b;i++)
#define mpi                map<pair<ll ,ll >,ll >
#define pii                pair<ll ,ll >
#define ppb                pop_back
#define F                  first
#define vi                 vector<ll >
#define vii                vector<pair<ll , ll> >
#define si                 set <ll>
#define vs                 vector<string>
#define all(a)             (a).begin(),(a).end()
#define sz(x)              (ll )x.size()
#define hell               1000000000000
#define bs                 binary_search
#define mp                 make_pair
#define qi                 queue<ll>
#define qs                 queue<string>
#define qpi                queue<pair<ll,ll> >
#define qps                queue<pair<ll,string>>
#define endl               '\n'
#define itr(a,it)          for(typeof(a.begin()) it=a.begin();it!=a.end();it++)// This will produce const_iterator for const object and normal iterator for non-const object
#define ss                 set<string>
using namespace std;
#define U 998244353
#define N  300005
#define inf         1000000000000000
#define mod            1000000007
#define unique(v) v.erase(unique(v.begin(),v.end()),v.end())

typedef tree<pii,null_type,less<pii>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
//ll a[N];
//ll dp[N],dp1[N];
//set<ll>s[N];
//vi adj[100005];
//vi v[N];
//set<ll>s1[26],s2;
//ll int a[N],b[N];
//set<ll>adj[N];
//ll int vis[N];
//void initialize()
//{
 //rep(i,0,1005)
//{
  //  vis[i]=0;
//}
//}
//sti st;
//bool vis[N];
//void dfs(ll node)
//{
//if(vis[node]==1)
 //{
  //   return;
 //}
 //vis[node]=1;
 //m2[node]=sz(v);
//set<ll>::iterator it=adj[node].begin();
//for(ll i=0;i<sz(adj[node]);i++)
//for(auto it:adj[node])
 //{
  //if(!vis[it])
  //{
   //dfs(it,dist+1,node);
   //m1[node]+=m1[it];
   //m2[node]+=m2[it];
     //m1[node]=sz(v);
  // }
  //}
//}
//ll fast_pow(ll b, ll n,ll MOD)
//{
  //  if(n==0)
    //   return 1;
    //if(n==1)
    //return b;
    //ll h=fast_pow(b,n/2,mod);
    //if(n%2==0)
      //  return ( h * h ) % mod;
    //else
      //  return ( ( ( h * h ) % mod ) * b ) % mod;
//}
//set<pair<ll,ll>>s[N];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie();
    cout.tie(0);
   //freopen("input.txt", "r", stdin);
   // freopen("output1.txt", "w", stdout);
   ll n,m,p=0,q=0,l=0,i,t,flag=0,k,j,r=0,curr=0,d;
   cin>>n>>m;
   p=n+m;
   j=int(sqrt(1+8*p));
   j--;
   j/=2;
   mii m1;
   vi v,v1;
   if(n>m)
   {
    flag=1;
    swap(n,m);
   }
   rep(l,1,j+1)
   {
    if(n-curr<=j)
    {
      v.pb(n-curr);
      m1[n-curr]=1;
      break;
    }
    else
    {
      curr+=l;
      v.pb(l);
      m1[l]=1;
    }
   }
  rep(l,1,j+1)
  {
    if(m1[l]==0&&q<m)
    {
      q+=l;
    v1.pb(l);
     }
  }
  if(flag==0)
  {
 cout<<sz(v)<<endl;
 rep(i,0,sz(v))
 {
  cout<<v[i]<<" ";
 }
 cout<<endl;
 cout<<sz(v1)<<endl;
 rep(i,0,sz(v1))
 {
  cout<<v1[i]<<" ";
 }
}
else
{
  cout<<sz(v1)<<endl;
 rep(i,0,sz(v1))
 {
  cout<<v1[i]<<" ";
 }
 cout<<endl;
 cout<<sz(v)<<endl;
 rep(i,0,sz(v))
 {
  cout<<v[i]<<" ";
 }
}

return 0;
}


a, b = map(int, input().split())
k = 0
while (k + k**2)//2<=(a + b)-1:
    k +=1
A = []
for i in range (1, k+1):
    A.append(i)
List_1 = []
for i in range (k-1, -1, -1):
    if A[i]<=a:
        List_1.append(A[i])
        a-=A[i]
        A.pop(i)
print(len(List_1))
print(*List_1)
print(len(A))
print(*A)


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    int ans = 0;
    set<int> ansn;
    while ((ans + 2) * (ans + 1) / 2 <= a + b)
    {
        ans++;
        ansn.insert(ans);
    }
    vector<int> ans1;
    for (int i = ans; i > 0; --i)
    {
        if (i <= a)
        {
            ans1.push_back(i);
            a -= i;
            ansn.erase(i);
        }
    }
    cout << ans1.size() << endl;

    for (auto el : ans1)
    {
        cout << el << " ";
    }
    if (ans1.size() != 0)
    {
        cout << endl;
    }
    cout << ansn.size() << endl;

    for (auto el : ansn)
    {
        cout << el << " ";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    int ans = 0;
    while ((ans + 2) * (ans + 1) / 2 <= a + b)
    {
        ans++;
    }
    vector<int> ans1, ans2;
    for (int i = ans; i > 0; --i)
    {
        if (i <= a)
        {
            ans1.push_back(i);
            a -= i;
        }
    }
    cout << ans1.size() << endl;
    for (int i = 1; i <= ans; ++i)
    {
        if (ans1.back() == i)
        {
            cout << i << " ";
            ans1.pop_back();
        }
        else
        {
            ans2.push_back(i);
        }
    }
    cout << endl;
    cout << ans2.size() << endl;
    for (auto el : ans2)
    {
        cout << el << " ";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    int ans = 0;
    while ((ans + 2) * (ans + 1) / 2 <= a + b)
    {
        ans++;
    }
    vector<int> ans1, ans2;
    for (int i = ans; i > 0; --i)
    {
        if (i <= a)
        {
            ans1.push_back(i);
            a -= i;
        }
    }
    cout << ans1.size() << endl;
    // if (ans1.size() == 0)
    // {
    //     for (int i = 1; i <= ans; ++i)
    //     {
    //         ans2.push_back(i);
    //     }
    // }
    for (int i = 1; i <= ans; ++i)
    {
        if (ans1.size() != 0 && ans1.back() == i)
        {
            cout << i << " ";
            ans1.pop_back();
        }
        else
        {
            ans2.push_back(i);
        }
    }
    if (ans1.size() != 0)
    {
        cout << endl;
    }
    cout << ans2.size() << endl;

    for (auto el : ans2)
    {
        cout << el << " ";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long a, b;
    cin >> a >> b;
    int r = 1e9, l = 1, ans;
    while (r > l + 1)
    {
        ans = (r + l) / 2;
        long long t = (long long)ans * (ans + 1) / 2;
        if (t > a + b)
        {
            r = ans;
        }
        else
        {
            l = ans;
        }
    }
    ans = (r + l) / 2;
    set<int> ansn;
    for (int i = 1; i <= ans; ++i)
    {
        ansn.insert(i);
    }
    vector<int> ans1;
    for (int i = ans; i > 0; --i)
    {
        if (i <= a)
        {
            ans1.push_back(i);
            a -= i;
            ansn.erase(i);
        }
    }
    cout << ans1.size() << endl;

    for (auto el : ans1)
    {
        cout << el << " ";
    }
    if (ans1.size() != 0)
    {
        cout << endl;
    }
    cout << ansn.size() << endl;

    for (auto el : ansn)
    {
        cout << el << " ";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long a, b;
    cin >> a >> b;
    int r = 1e9, l = 1, ans;
    while (r > l + 1)
    {
        ans = (r + l) / 2;
        long long t = (long long)ans * (ans + 1) / 2;
        if (t > a + b)
        {
            r = ans;
        }
        else
        {
            l = ans;
        }
    }
    set<int> ansn;
    for (int i = 1; i <= ans; ++i)
    {
        ansn.insert(i);
    }
    vector<int> ans1;
    for (int i = ans; i > 0; --i)
    {
        if (i <= a)
        {
            ans1.push_back(i);
            a -= i;
            ansn.erase(i);
        }
    }
    cout << ans1.size() << endl;

    for (auto el : ans1)
    {
        cout << el << " ";
    }
    if (ans1.size() != 0)
    {
        cout << endl;
    }
    cout << ansn.size() << endl;

    for (auto el : ansn)
    {
        cout << el << " ";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long a, b;
    cin >> a >> b;
    int r = 1e9, l = 0, ans;
    while (r > l + 1)
    {
        ans = (r + l) / 2;
        long long t = (long long)ans * (ans + 1) / 2;
        if (t > a + b)
        {
            r = ans;
        }
        else
        {
            l = ans;
        }
    }
    ans = (r + l) / 2;
    set<int> ansn;
    for (int i = 1; i <= ans; ++i)
    {
        ansn.insert(i);
    }
    vector<int> ans1;
    for (int i = ans; i > 0; --i)
    {
        if (i <= a)
        {
            ans1.push_back(i);
            a -= i;
            ansn.erase(i);
        }
    }
    cout << ans1.size() << endl;

    for (auto el : ans1)
    {
        cout << el << " ";
    }
    if (ans1.size() != 0)
    {
        cout << endl;
    }
    cout << ansn.size() << endl;

    for (auto el : ansn)
    {
        cout << el << " ";
    }
}


#include <bits/stdc++.h>
#define ll long long
#define MAX 5000000000
#define MOD 1000000007
#define mp make_pair
//bool arr[MAX] ;

using namespace std ;

void print(vector<ll>v)
{
    vector<ll>::iterator it = v.begin() ;

    while(it!=v.end())
    {
        cout<<*it<<" " ;
        it++ ;
    }
    cout<<endl ;
}
void printp(vector<pair<int,int>>v)
{
    vector<pair<int,int>>::iterator it = v.begin() ;
    while(it!=v.end())
    {
        cout<<(*it).first<<" "<<(*it).second<<endl  ;
        it++ ;
    }
}
ll gcd(ll x , ll y)
{
    if(y==0)
    {
        return x ;
    }

    if(x!=max(x,y))
        swap(x,y) ;
    return gcd(y,x%y) ;

}

int main()
{
    ll a,b ;
    cin>>a>>b ;
    ll x = (sqrt(8*(a+b)+1)-1)/2 ;
    vector<bool>vec(x+1) ;
    ll i = 1 ;
    bool deb = 0 ;
    if(a>b)
    {
        deb = 1 ;
        swap(a,b) ;
    }
    while(a>x)
    {
        a = a-i ;
        vec[i]=1 ;
        i++ ;
    }
    vec[a]=1 ;
    vector<ll>vc1,vc2 ;
    for(ll j = 1 ; j<=x ; j++)
    {
        if(vec[j]==1)
        {
            vc1.push_back(j) ;
        }
        else
        {
            vc2.push_back(j) ;
        }

    }
    if(deb==0)
    {

    cout<<vc1.size()<<endl ;
    print(vc1) ;
    cout<<vc2.size()<<endl ;
    print(vc2) ;
    }
    else
    {
        cout<<vc2.size()<<endl ;
    print(vc2) ;
    cout<<vc1.size()<<endl ;
    print(vc1) ;
    }

}


#include <bits/stdc++.h>
#define ll long long
#define MAX 5000000000
#define MOD 1000000007
#define mp make_pair
//bool arr[MAX] ;

using namespace std ;

void print(vector<ll>v)
{
    vector<ll>::iterator it = v.begin() ;

    while(it!=v.end())
    {
        cout<<*it<<" " ;
        it++ ;
    }
    cout<<endl ;
}
void printp(vector<pair<int,int>>v)
{
    vector<pair<int,int>>::iterator it = v.begin() ;
    while(it!=v.end())
    {
        cout<<(*it).first<<" "<<(*it).second<<endl  ;
        it++ ;
    }
}
ll gcd(ll x , ll y)
{
    if(y==0)
    {
        return x ;
    }

    if(x!=max(x,y))
        swap(x,y) ;
    return gcd(y,x%y) ;

}

int main()
{
    ll a,b ;
    cin>>a>>b ;
    ll x = (sqrt(8*(a+b)+1)-1)/2 ;
    vector<bool>vec(x+1) ;
    ll i = x ;
    while(i>=1 && a>i)
    {
        a = a-i ;
        vec[i]=1 ;
        i-- ;
    }
    vec[a]=1 ;
    vector<ll>vc1,vc2 ;
    for(ll j = 1 ; j<=x ; j++)
    {
        if(vec[j]==1)
        {
            vc1.push_back(j) ;
        }
        else
        {
            vc2.push_back(j) ;
        }

    }
    cout<<vc1.size()<<endl ;
    print(vc1) ;
    cout<<vc2.size()<<endl ;
    print(vc2) ;
}


#include <bits/stdc++.h>
#define ll long long
#define MAX 5000000000
#define MOD 1000000007
#define mp make_pair
//bool arr[MAX] ;

using namespace std ;

void print(vector<ll>v)
{
    vector<ll>::iterator it = v.begin() ;

    while(it!=v.end())
    {
        cout<<*it<<" " ;
        it++ ;
    }
    cout<<endl ;
}
void printp(vector<pair<int,int>>v)
{
    vector<pair<int,int>>::iterator it = v.begin() ;
    while(it!=v.end())
    {
        cout<<(*it).first<<" "<<(*it).second<<endl  ;
        it++ ;
    }
}
ll gcd(ll x , ll y)
{
    if(y==0)
    {
        return x ;
    }

    if(x!=max(x,y))
        swap(x,y) ;
    return gcd(y,x%y) ;

}

int main()
{
    ll a,b ;
    cin>>a>>b ;
    ll x = (sqrt(8*(a+b)+1)-1)/2 ;
    vector<bool>vec(x+1) ;
    ll i = 1 ;
    while(a>x)
    {
        a = a-i ;
        vec[i]=1 ;
        i++ ;
    }
    vec[a]=1 ;
    vector<ll>vc1,vc2 ;
    for(ll j = 1 ; j<=x ; j++)
    {
        if(vec[j]==1)
        {
            vc1.push_back(j) ;
        }
        else
        {
            vc2.push_back(j) ;
        }

    }
    cout<<vc1.size()<<endl ;
    print(vc1) ;
    cout<<vc2.size()<<endl ;
    print(vc2) ;

}


#include <bits/stdc++.h>
#define ll long long
#define MAX 5000000000
#define MOD 1000000007
#define mp make_pair
//bool arr[MAX] ;

using namespace std ;

void print(vector<ll>v)
{
    vector<ll>::iterator it = v.begin() ;

    while(it!=v.end())
    {
        cout<<*it<<" " ;
        it++ ;
    }
    cout<<endl ;
}
void printp(vector<pair<int,int>>v)
{
    vector<pair<int,int>>::iterator it = v.begin() ;
    while(it!=v.end())
    {
        cout<<(*it).first<<" "<<(*it).second<<endl  ;
        it++ ;
    }
}
ll gcd(ll x , ll y)
{
    if(y==0)
    {
        return x ;
    }

    if(x!=max(x,y))
        swap(x,y) ;
    return gcd(y,x%y) ;

}

int main()
{
    ll a,b ;
    cin>>a>>b ;
    ll x = (sqrt(8*(a+b)+1)-1)/2 ;
    vector<bool>vec(x+1) ;
    ll i = x ;
    while(a>i)
    {
        a = a-i ;
        vec[i]=1 ;
        i-- ;
    }
    vec[a]=1 ;
    vector<ll>vc1,vc2 ;
    for(ll j = 1 ; j<=x ; j++)
    {
        if(vec[j]==1)
        {
            vc1.push_back(j) ;
        }
        else
        {
            vc2.push_back(j) ;
        }

    }
    cout<<vc1.size()<<endl ;
    print(vc1) ;
    cout<<vc2.size()<<endl ;
    print(vc2) ;
}


#include <bits/stdc++.h>
#define ll long long
#define MAX 5000000000
#define MOD 1000000007
#define mp make_pair
//bool arr[MAX] ;

using namespace std ;

void print(vector<ll>v)
{
    vector<ll>::iterator it = v.begin() ;

    while(it!=v.end())
    {
        cout<<*it<<" " ;
        it++ ;
    }
    cout<<endl ;
}
void printp(vector<pair<int,int>>v)
{
    vector<pair<int,int>>::iterator it = v.begin() ;
    while(it!=v.end())
    {
        cout<<(*it).first<<" "<<(*it).second<<endl  ;
        it++ ;
    }
}
ll gcd(ll x , ll y)
{
    if(y==0)
    {
        return x ;
    }

    if(x!=max(x,y))
        swap(x,y) ;
    return gcd(y,x%y) ;

}

int main()
{
    ll a,b ;
    cin>>a>>b ;
    ll x = (sqrt(8*(a+b)+1)-1)/2 ;
    vector<bool>vec(x+1) ;
    ll i = x ;
    while(a>=i)
    {
        a = a-i ;
        vec[i]=1 ;
        i-- ;
    }
    vec[a]=1 ;
    vector<ll>vc1,vc2 ;
    for(ll j = 1 ; j<=x ; j++)
    {
        if(vec[j]==1)
        {
            vc1.push_back(j) ;
        }
        else
        {
            vc2.push_back(j) ;
        }

    }
    cout<<vc1.size()<<endl ;
    print(vc1) ;
    cout<<vc2.size()<<endl ;
    print(vc2) ;
}


#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

unordered_set<ll> s;

int main()
{
    ll a, b;
    cin >> a >> b;
    ll x;
    for(ll x1 = 1e9; x1 >= 1; x1--)
    {
        if (x1 * (x1 + 1) / 2 <= a + b)
        {
            x = x1;
            break;
        }
    }
    vector<ll> first;
    vector<ll> second;
    while (x > 0)
    {
        if (a - x >= 0)
        {
            a -= x;
            first.push_back(x);
        }
        else
        {
            b -= x;
            second.push_back(x);
        }
        x--;
    }
    cout << first.size() << "\n";
    for (ll i = 0; i < first.size(); i++)
    {
        cout << first[i] << " ";
    }
    cout << '\n';
    cout << second.size() << "\n";
    for (ll i = 0; i < second.size(); i++)
    {
        cout << second[i] << " ";
    }
}


#include <bits/stdc++.h>

typedef int ll;

using namespace std;

unordered_set<ll> s;

int main()
{
    ll a, b;
    cin >> a >> b;
    ll x;
    for(ll x1 = 1e9; x1 >= 1; x1--)
    {
        if (x1 * (x1 + 1) / 2 <= a + b)
        {
            x = x1;
            break;
        }
    }
    vector<ll> first;
    vector<ll> second;
    while (x > 0)
    {
        if (a - x >= 0)
        {
            a -= x;
            first.push_back(x);
        }
        else
        {
            b -= x;
            second.push_back(x);
        }
        x--;
    }
    cout << first.size() << "\n";
    for (ll i = 0; i < first.size(); i++)
    {
        cout << first[i] << " ";
    }
    cout << '\n';
    cout << second.size() << "\n";
    for (ll i = 0; i < second.size(); i++)
    {
        cout << second[i] << " ";
    }
}


#include <bits/stdc++.h>

typedef int ll;

using namespace std;

unordered_set<ll> s;

int main()
{
    ll a, b;
    cin >> a >> b;
    ll x;
    for(ll x1 = 100; x1 >= 1; x1--)
    {
        if (x1 * (x1 + 1) / 2 <= a + b)
        {
            x = x1;
            break;
        }
    }
    vector<ll> first;
    vector<ll> second;
    while (x > 0)
    {
        if (a - x >= 0)
        {
            a -= x;
            first.push_back(x);
        }
        else
        {
            b -= x;
            second.push_back(x);
        }
        x--;
    }
    cout << first.size() << "\n";
    for (ll i = 0; i < first.size(); i++)
    {
        cout << first[i] << " ";
    }
    cout << '\n';
    cout << second.size() << "\n";
    for (ll i = 0; i < second.size(); i++)
    {
        cout << second[i] << " ";
    }
}


#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

int main()
{
    ll a, b;
    cin >> a >> b;
    ll sum = a + b;
    ll x = (-1 + sqrt(1 + 8 * sum)) / 2;
    vector<ll> first;
    vector<ll> second;
    while (x > 0)
    {
        if (a - x >= 0)
        {
            a -= x;
            first.push_back(x);
        }
        else
        {
            b -= x;
            second.push_back(x);
        }
        x--;
    }
    cout << first.size() << "\n";
    for (ll i = 0; i < first.size(); i++)
    {
        cout << first[i] << " ";
    }
    cout << '\n';
    cout << second.size() << "\n";
    for (ll i = 0; i < second.size(); i++)
    {
        cout << second[i] << " ";
    }
}


#include <bits/stdc++.h>

typedef unsigned long long ll;

using namespace std;

int main()
{
    ll a, b;
    cin >> a >> b;
    ll x;
    for(ll x1 = 1e6; x1 >= 1; x1--)
    {
        if (x1 * (x1 + 1) / 2 <= a + b)
        {
            x = x1;
            break;
        }
    }
    vector<ll> first;
    vector<ll> second;
    while (x > 0)
    {
        if (a - x >= 0)
        {
            a -= x;
            first.push_back(x);
        }
        else
        {
            b -= x;
            second.push_back(x);
        }
        x--;
    }
    cout << first.size() << "\n";
    for (ll i = 0; i < first.size(); i++)
    {
        cout << first[i] << " ";
    }
    cout << '\n';
    cout << second.size() << "\n";
    for (ll i = 0; i < second.size(); i++)
    {
        cout << second[i] << " ";
    }
}


#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

int main()
{
    ll a, b;
    cin >> a >> b;
    ll x;
    for(ll x1 = 1e4; x1 >= 1; x1--)
    {
        if (x1 * (x1 + 1) / 2 <= a + b)
        {
            x = x1;
            break;
        }
    }
    vector<ll> first;
    vector<ll> second;
    while (x > 0)
    {
        if (a - x >= 0)
        {
            a -= x;
            first.push_back(x);
        }
        else
        {
            b -= x;
            second.push_back(x);
        }
        x--;
    }
    cout << first.size() << "\n";
    for (ll i = 0; i < first.size(); i++)
    {
        cout << first[i] << " ";
    }
    cout << '\n';
    cout << second.size() << "\n";
    for (ll i = 0; i < second.size(); i++)
    {
        cout << second[i] << " ";
    }
}


#include <bits/stdc++.h>
#include <unistd.h>
using namespace std;

using ll = long long;

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char c) {
  return string(1,c);
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (int i = int(N)-1; i >= 0; --i) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef COMPETITIVE_PROGRAMMING_LOCAL
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define dbg(...) if(0){}
#endif

template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;

struct Scanner {
  int fd = -1;
  char line[(1 << 15) + 1];
  size_t st = 0, ed = 0;
  void reread() {
    memmove(line, line + st, ed - st);
    ed -= st;
    st = 0;
    ed += ::read(fd, line + ed, (1 << 15) - ed);
    line[ed] = '\0';
  }
  bool succ() {
    while (true) {
      if (st == ed) {
        reread();
        if (st == ed) return false;
      }
      while (st != ed && isspace(line[st])) st++;
      if (st != ed) break;
    }
    if (ed - st <= 50) {
      bool sep = false;
      for (size_t i = st; i < ed; i++) {
        if (isspace(line[i])) {
          sep = true;
          break;
        }
      }
      if (!sep) reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_same<T, string>::value, int> = 0>
  bool read_single(T& ref) {
    if (!succ()) return false;
    while (true) {
      size_t sz = 0;
      while (st + sz < ed && !isspace(line[st + sz])) sz++;
      ref.append(line + st, sz);
      st += sz;
      if (!sz || st != ed) break;
      reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  bool read_single(T& ref) {
    if (!succ()) return false;
    bool neg = false;
    if (line[st] == '-') {
      neg = true;
      st++;
    }
    ref = T(0);
    while (isdigit(line[st])) {
      ref = 10 * ref + (line[st++] & 0xf);
    }
    if (neg) ref = -ref;
    return true;
  }
  template <class T> bool read_single(V<T>& ref) {
    for (auto& d : ref) {
      if (!read_single(d)) return false;
    }
    return true;
  }
  template <class T> bool read_single(array<T,2>& ref) {
    if (!read_single(ref[0])) return false;
    if (!read_single(ref[1])) return false;
    return true;
  }
  template <class T> bool read_single(array<T,3>& ref) {
    if (!read_single(ref[0])) return false;
    if (!read_single(ref[1])) return false;
    if (!read_single(ref[2])) return false;
    return true;
  }
  template <class T> bool read_single(array<T,4>& ref) {
    if (!read_single(ref[0])) return false;
    if (!read_single(ref[1])) return false;
    if (!read_single(ref[2])) return false;
    if (!read_single(ref[3])) return false;
    return true;
  }
  void read() {}
  template <class H, class... T> void read(H& h, T&... t) {
    bool f = read_single(h);
    assert(f);
    read(t...);
  }
  Scanner(FILE* fp) : fd(fileno(fp)) {}
};

struct Printer {
public:
  template <bool F = false> void write() {}
  template <bool F = false, class H, class... T>
  void write(const H& h, const T&... t) {
    if (F) write_single(' ');
    write_single(h);
    write<true>(t...);
  }
  template <class... T> void writeln(const T&... t) {
    write(t...);
    write_single('\n');
  }

  Printer(FILE* _fp) : fp(_fp) {}
  ~Printer() { flush(); }

private:
  static constexpr size_t SIZE = 1 << 15;
  FILE* fp;
  char line[SIZE], small[50];
  size_t pos = 0;
  void flush() {
    fwrite(line, 1, pos, fp);
    pos = 0;
  }
  void write_single(const char& val) {
    if (pos == SIZE) flush();
    line[pos++] = val;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  void write_single(T val) {
    if (pos > (1 << 15) - 50) flush();
    if (val == 0) {
      write_single('0');
      return;
    }
    if (val < 0) {
      write_single('-');
      val = -val; // todo min
    }
    size_t len = 0;
    while (val) {
      small[len++] = char(0x30 | (val % 10));
      val /= 10;
    }
    for (size_t i = 0; i < len; i++) {
      line[pos + i] = small[len - 1 - i];
    }
    pos += len;
  }
  void write_single(const string& s) {
    for (char c : s) write_single(c);
  }
  void write_single(const char* s) {
    size_t len = strlen(s);
    for (size_t i = 0; i < len; i++) write_single(s[i]);
  }
  template <class T> void write_single(const V<T>& val) {
    auto n = val.size();
    for (size_t i = 0; i < n; i++) {
      if (i) write_single(' ');
      write_single(val[i]);
    }
  }
};

Scanner sc = Scanner(stdin);
Printer pr = Printer(stdout);
#define int ll

ll GetK(ll sum) {
  ll l = 0, r = sum+1;
  while (r-l > 1) {
    ll m = l + (r-l)/2;
    if (m*(m+1)/2 <= sum) {
      l = m;
    } else {
      r = m;
    }
  }
  return l;
}

int32_t main() {
  ios::sync_with_stdio(0); cin.tie(0);

  ll a,b;
  sc.read(a,b);
  ll k = GetK(a+b);
  ll orig_k = k;
//  dbg(k);
  vector<int> A;
  while (a >= k && k >= 1) {
    A.push_back(k);
    a -= k--;
  }
  if (a >= 1) {
    A.push_back(a);
  }
#ifndef COMPETITIVE_PROGRAMMING_LOCAL
  pr.writeln(A.size());
  pr.writeln(A);
#endif
//  dbg(A.size());
  A.clear();

  for (int i = 1; i <= k; ++i) {
    if (i == a) continue;
    if (i > b) break;
    A.push_back(i);
    b -= i;
  }
  if (b >= orig_k) {
    A.push_back(orig_k);
  }
//  dbg(A.size());

#ifndef COMPETITIVE_PROGRAMMING_LOCAL
  pr.writeln(A.size());
  pr.writeln(A);
#endif
}


#include <bits/stdc++.h>
#include <unistd.h>
using namespace std;

using ll = long long;

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char c) {
  return string(1,c);
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (int i = int(N)-1; i >= 0; --i) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef COMPETITIVE_PROGRAMMING_LOCAL
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define dbg(...) if(0){}
#endif

template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;

struct Scanner {
  int fd = -1;
  char line[(1 << 15) + 1];
  size_t st = 0, ed = 0;
  void reread() {
    memmove(line, line + st, ed - st);
    ed -= st;
    st = 0;
    ed += ::read(fd, line + ed, (1 << 15) - ed);
    line[ed] = '\0';
  }
  bool succ() {
    while (true) {
      if (st == ed) {
        reread();
        if (st == ed) return false;
      }
      while (st != ed && isspace(line[st])) st++;
      if (st != ed) break;
    }
    if (ed - st <= 50) {
      bool sep = false;
      for (size_t i = st; i < ed; i++) {
        if (isspace(line[i])) {
          sep = true;
          break;
        }
      }
      if (!sep) reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_same<T, string>::value, int> = 0>
  bool read_single(T& ref) {
    if (!succ()) return false;
    while (true) {
      size_t sz = 0;
      while (st + sz < ed && !isspace(line[st + sz])) sz++;
      ref.append(line + st, sz);
      st += sz;
      if (!sz || st != ed) break;
      reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  bool read_single(T& ref) {
    if (!succ()) return false;
    bool neg = false;
    if (line[st] == '-') {
      neg = true;
      st++;
    }
    ref = T(0);
    while (isdigit(line[st])) {
      ref = 10 * ref + (line[st++] & 0xf);
    }
    if (neg) ref = -ref;
    return true;
  }
  template <class T> bool read_single(V<T>& ref) {
    for (auto& d : ref) {
      if (!read_single(d)) return false;
    }
    return true;
  }
  template <class T> bool read_single(array<T,2>& ref) {
    if (!read_single(ref[0])) return false;
    if (!read_single(ref[1])) return false;
    return true;
  }
  template <class T> bool read_single(array<T,3>& ref) {
    if (!read_single(ref[0])) return false;
    if (!read_single(ref[1])) return false;
    if (!read_single(ref[2])) return false;
    return true;
  }
  template <class T> bool read_single(array<T,4>& ref) {
    if (!read_single(ref[0])) return false;
    if (!read_single(ref[1])) return false;
    if (!read_single(ref[2])) return false;
    if (!read_single(ref[3])) return false;
    return true;
  }
  void read() {}
  template <class H, class... T> void read(H& h, T&... t) {
    bool f = read_single(h);
    assert(f);
    read(t...);
  }
  Scanner(FILE* fp) : fd(fileno(fp)) {}
};

struct Printer {
public:
  template <bool F = false> void write() {}
  template <bool F = false, class H, class... T>
  void write(const H& h, const T&... t) {
    if (F) write_single(' ');
    write_single(h);
    write<true>(t...);
  }
  template <class... T> void writeln(const T&... t) {
    write(t...);
    write_single('\n');
  }

  Printer(FILE* _fp) : fp(_fp) {}
  ~Printer() { flush(); }

private:
  static constexpr size_t SIZE = 1 << 15;
  FILE* fp;
  char line[SIZE], small[50];
  size_t pos = 0;
  void flush() {
    fwrite(line, 1, pos, fp);
    pos = 0;
  }
  void write_single(const char& val) {
    if (pos == SIZE) flush();
    line[pos++] = val;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  void write_single(T val) {
    if (pos > (1 << 15) - 50) flush();
    if (val == 0) {
      write_single('0');
      return;
    }
    if (val < 0) {
      write_single('-');
      val = -val; // todo min
    }
    size_t len = 0;
    while (val) {
      small[len++] = char(0x30 | (val % 10));
      val /= 10;
    }
    for (size_t i = 0; i < len; i++) {
      line[pos + i] = small[len - 1 - i];
    }
    pos += len;
  }
  void write_single(const string& s) {
    for (char c : s) write_single(c);
  }
  void write_single(const char* s) {
    size_t len = strlen(s);
    for (size_t i = 0; i < len; i++) write_single(s[i]);
  }
  template <class T> void write_single(const V<T>& val) {
    auto n = val.size();
    for (size_t i = 0; i < n; i++) {
      if (i) write_single(' ');
      write_single(val[i]);
    }
  }
};

Scanner sc = Scanner(stdin);
Printer pr = Printer(stdout);
#define int ll

ll GetK(ll sum) {
  ll l = 0, r = sum+1;
  while (r-l > 1) {
    ll m = l + (r-l)/2;
    if (m*(m+1)/2 <= sum) {
      l = m;
    } else {
      r = m;
    }
  }
  return l;
}

int32_t main() {
  ios::sync_with_stdio(0); cin.tie(0);

  ll a,b;
  sc.read(a,b);
  ll k = GetK(a+b);
  ll orig_k = k+1;
//  dbg(k);
  vector<int> A;
  while (a >= k && k >= 1) {
    A.push_back(k);
    a -= k--;
  }
  if (a >= 1) {
    A.push_back(a);
  }
#ifndef COMPETITIVE_PROGRAMMING_LOCAL
  pr.writeln(A.size());
  pr.writeln(A);
#endif
//  dbg(A.size());
  A.clear();

  for (int i = 1; i <= k; ++i) {
    if (i == a) continue;
    if (i > b) break;
    A.push_back(i);
    b -= i;
  }
  if (b >= orig_k) {
    A.push_back(orig_k);
  }
//  dbg(A.size());

#ifndef COMPETITIVE_PROGRAMMING_LOCAL
  pr.writeln(A.size());
  pr.writeln(A);
#endif
}


#include <bits/stdc++.h>
#include <unistd.h>
using namespace std;

using ll = long long;
constexpr ll mod = 1e9 + 7;
#define endl '\n'

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char c) {
  return string(1,c);
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (int i = int(N)-1; i >= 0; --i) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef COMPETITIVE_PROGRAMMING_LOCAL
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define dbg(...) if(0){}
#endif

template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;

struct Scanner {
  int fd = -1;
  char line[(1 << 15) + 1];
  size_t st = 0, ed = 0;
  void reread() {
    memmove(line, line + st, ed - st);
    ed -= st;
    st = 0;
    ed += ::read(fd, line + ed, (1 << 15) - ed);
    line[ed] = '\0';
  }
  bool succ() {
    while (true) {
      if (st == ed) {
        reread();
        if (st == ed) return false;
      }
      while (st != ed && isspace(line[st])) st++;
      if (st != ed) break;
    }
    if (ed - st <= 50) {
      bool sep = false;
      for (size_t i = st; i < ed; i++) {
        if (isspace(line[i])) {
          sep = true;
          break;
        }
      }
      if (!sep) reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_same<T, string>::value, int> = 0>
  bool read_single(T& ref) {
    if (!succ()) return false;
    while (true) {
      size_t sz = 0;
      while (st + sz < ed && !isspace(line[st + sz])) sz++;
      ref.append(line + st, sz);
      st += sz;
      if (!sz || st != ed) break;
      reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  bool read_single(T& ref) {
    if (!succ()) return false;
    bool neg = false;
    if (line[st] == '-') {
      neg = true;
      st++;
    }
    ref = T(0);
    while (isdigit(line[st])) {
      ref = 10 * ref + (line[st++] & 0xf);
    }
    if (neg) ref = -ref;
    return true;
  }
  template <class T> bool read_single(V<T>& ref) {
    for (auto& d : ref) {
      if (!read_single(d)) return false;
    }
    return true;
  }
  template <class T> bool read_single(array<T,2>& ref) {
    if (!read_single(ref[0])) return false;
    if (!read_single(ref[1])) return false;
    return true;
  }
  template <class T> bool read_single(array<T,3>& ref) {
    if (!read_single(ref[0])) return false;
    if (!read_single(ref[1])) return false;
    if (!read_single(ref[2])) return false;
    return true;
  }
  template <class T> bool read_single(array<T,4>& ref) {
    if (!read_single(ref[0])) return false;
    if (!read_single(ref[1])) return false;
    if (!read_single(ref[2])) return false;
    if (!read_single(ref[3])) return false;
    return true;
  }
  void read() {}
  template <class H, class... T> void read(H& h, T&... t) {
    bool f = read_single(h);
    assert(f);
    read(t...);
  }
  Scanner(FILE* fp) : fd(fileno(fp)) {}
};

struct Printer {
public:
  template <bool F = false> void write() {}
  template <bool F = false, class H, class... T>
  void write(const H& h, const T&... t) {
    if (F) write_single(' ');
    write_single(h);
    write<true>(t...);
  }
  template <class... T> void writeln(const T&... t) {
    write(t...);
    write_single('\n');
  }

  Printer(FILE* _fp) : fp(_fp) {}
  ~Printer() { flush(); }

private:
  static constexpr size_t SIZE = 1 << 15;
  FILE* fp;
  char line[SIZE], small[50];
  size_t pos = 0;
  void flush() {
    fwrite(line, 1, pos, fp);
    pos = 0;
  }
  void write_single(const char& val) {
    if (pos == SIZE) flush();
    line[pos++] = val;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  void write_single(T val) {
    if (pos > (1 << 15) - 50) flush();
    if (val == 0) {
      write_single('0');
      return;
    }
    if (val < 0) {
      write_single('-');
      val = -val; // todo min
    }
    size_t len = 0;
    while (val) {
      small[len++] = char(0x30 | (val % 10));
      val /= 10;
    }
    for (size_t i = 0; i < len; i++) {
      line[pos + i] = small[len - 1 - i];
    }
    pos += len;
  }
  void write_single(const string& s) {
    for (char c : s) write_single(c);
  }
  void write_single(const char* s) {
    size_t len = strlen(s);
    for (size_t i = 0; i < len; i++) write_single(s[i]);
  }
  template <class T> void write_single(const V<T>& val) {
    auto n = val.size();
    for (size_t i = 0; i < n; i++) {
      if (i) write_single(' ');
      write_single(val[i]);
    }
  }
};

Scanner sc = Scanner(stdin);
Printer pr = Printer(stdout);
#define int ll

ll GetK(ll sum) {
  ll l = 0, r = sum+1;
  while (r-l > 1) {
    ll m = l + (r-l)/2;
    if (m*(m+1)/2 <= sum) {
      l = m;
    } else {
      r = m;
    }
  }
  return l;
}
int32_t main() {
  ios::sync_with_stdio(0); cin.tie(0);

  ll a,b;
  sc.read(a,b);
  ll k = GetK(a+b);
  dbg(k);
  vector<int> A;
  while (a >= k) {
    A.push_back(k);
    a -= k--;
  }
  if (a >= 1) {
    A.push_back(a);
  }
#ifndef COMPETITIVE_PROGRAMMING_LOCAL
  pr.writeln(A.size());
  pr.writeln(A);
#endif
  dbg(A.size());
  A.clear();

  for (int i = 1; i <= k; ++i) {
    if (i == a) continue;
    if (i > b) break;
    A.push_back(i);
    b -= i;
  }
  dbg(A.size());

#ifndef COMPETITIVE_PROGRAMMING_LOCAL
  pr.writeln(A.size());
  pr.writeln(A);
#endif
}


#include <bits/stdc++.h>
#include <unistd.h>
using namespace std;

using ll = long long;

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char c) {
  return string(1,c);
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (int i = int(N)-1; i >= 0; --i) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef COMPETITIVE_PROGRAMMING_LOCAL
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define dbg(...) if(0){}
#endif

template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;

struct Scanner {
  int fd = -1;
  char line[(1 << 15) + 1];
  size_t st = 0, ed = 0;
  void reread() {
    memmove(line, line + st, ed - st);
    ed -= st;
    st = 0;
    ed += ::read(fd, line + ed, (1 << 15) - ed);
    line[ed] = '\0';
  }
  bool succ() {
    while (true) {
      if (st == ed) {
        reread();
        if (st == ed) return false;
      }
      while (st != ed && isspace(line[st])) st++;
      if (st != ed) break;
    }
    if (ed - st <= 50) {
      bool sep = false;
      for (size_t i = st; i < ed; i++) {
        if (isspace(line[i])) {
          sep = true;
          break;
        }
      }
      if (!sep) reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_same<T, string>::value, int> = 0>
  bool read_single(T& ref) {
    if (!succ()) return false;
    while (true) {
      size_t sz = 0;
      while (st + sz < ed && !isspace(line[st + sz])) sz++;
      ref.append(line + st, sz);
      st += sz;
      if (!sz || st != ed) break;
      reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  bool read_single(T& ref) {
    if (!succ()) return false;
    bool neg = false;
    if (line[st] == '-') {
      neg = true;
      st++;
    }
    ref = T(0);
    while (isdigit(line[st])) {
      ref = 10 * ref + (line[st++] & 0xf);
    }
    if (neg) ref = -ref;
    return true;
  }
  template <class T> bool read_single(V<T>& ref) {
    for (auto& d : ref) {
      if (!read_single(d)) return false;
    }
    return true;
  }
  template <class T> bool read_single(array<T,2>& ref) {
    if (!read_single(ref[0])) return false;
    if (!read_single(ref[1])) return false;
    return true;
  }
  template <class T> bool read_single(array<T,3>& ref) {
    if (!read_single(ref[0])) return false;
    if (!read_single(ref[1])) return false;
    if (!read_single(ref[2])) return false;
    return true;
  }
  template <class T> bool read_single(array<T,4>& ref) {
    if (!read_single(ref[0])) return false;
    if (!read_single(ref[1])) return false;
    if (!read_single(ref[2])) return false;
    if (!read_single(ref[3])) return false;
    return true;
  }
  void read() {}
  template <class H, class... T> void read(H& h, T&... t) {
    bool f = read_single(h);
    assert(f);
    read(t...);
  }
  Scanner(FILE* fp) : fd(fileno(fp)) {}
};

struct Printer {
public:
  template <bool F = false> void write() {}
  template <bool F = false, class H, class... T>
  void write(const H& h, const T&... t) {
    if (F) write_single(' ');
    write_single(h);
    write<true>(t...);
  }
  template <class... T> void writeln(const T&... t) {
    write(t...);
    write_single('\n');
  }

  Printer(FILE* _fp) : fp(_fp) {}
  ~Printer() { flush(); }

private:
  static constexpr size_t SIZE = 1 << 15;
  FILE* fp;
  char line[SIZE], small[50];
  size_t pos = 0;
  void flush() {
    fwrite(line, 1, pos, fp);
    pos = 0;
  }
  void write_single(const char& val) {
    if (pos == SIZE) flush();
    line[pos++] = val;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  void write_single(T val) {
    if (pos > (1 << 15) - 50) flush();
    if (val == 0) {
      write_single('0');
      return;
    }
    if (val < 0) {
      write_single('-');
      val = -val; // todo min
    }
    size_t len = 0;
    while (val) {
      small[len++] = char(0x30 | (val % 10));
      val /= 10;
    }
    for (size_t i = 0; i < len; i++) {
      line[pos + i] = small[len - 1 - i];
    }
    pos += len;
  }
  void write_single(const string& s) {
    for (char c : s) write_single(c);
  }
  void write_single(const char* s) {
    size_t len = strlen(s);
    for (size_t i = 0; i < len; i++) write_single(s[i]);
  }
  template <class T> void write_single(const V<T>& val) {
    auto n = val.size();
    for (size_t i = 0; i < n; i++) {
      if (i) write_single(' ');
      write_single(val[i]);
    }
  }
};

Scanner sc = Scanner(stdin);
Printer pr = Printer(stdout);
#define int ll

ll GetK(ll sum) {
  ll l = 0, r = sum+1;
  while (r-l > 1) {
    ll m = l + (r-l)/2;
    if (m*(m+1)/2 <= sum) {
      l = m;
    } else {
      r = m;
    }
  }
  return l;
}

int32_t main() {
  ios::sync_with_stdio(0); cin.tie(0);

  ll a,b;
  sc.read(a,b);
  ll k = GetK(a+b);
//  dbg(k);
  vector<int> A;
  while (a >= k && k >= 1) {
    A.push_back(k);
    a -= k--;
  }
  if (a >= 1) {
    A.push_back(a);
  }
#ifndef COMPETITIVE_PROGRAMMING_LOCAL
  pr.writeln(A.size());
  pr.writeln(A);
#endif
//  dbg(A.size());
  A.clear();

  for (int i = 1; i <= k; ++i) {
    if (i == a) continue;
    if (i > b) break;
    A.push_back(i);
    b -= i;
  }
//  dbg(A.size());

#ifndef COMPETITIVE_PROGRAMMING_LOCAL
  pr.writeln(A.size());
  pr.writeln(A);
#endif
}