#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <queue>
#include <random>

using namespace std;

const long long MAXT = 1000000007;

int a, b;
vector<int> res;

int main() {
    cin >> a >> b;
    int minx = min(a, b);
    int maxx = max(a, b);
    for (int i = 0;i < minx-1;i ++) {
        res.push_back(i+1);
        res.push_back(-(i+1));
    }
    int sum = 0;
    for (int i = minx;i <= maxx;i ++) {
        if (minx == a) {
            res.push_back(-i);
            sum += (-i);
        } else {
            res.push_back(i);
            sum += i;
        }
    }
    res.push_back(-sum);
    for (int i = 0;i < res.size();i ++) {
        if (i == 0) cout << res[i];
        else cout << " " << res[i];
    }
    cout << endl;
    return 0;
}
#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
#include <random>
#include <cassert>
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using namespace std;
#define int long long
#define CONTAINS_VEC(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define REPE(i, n) for (int (i)=0; (i) <= (n); (i)++)
#define CONTAINS_MAP(m, a) ((m).find((a)) != m.end())
#define CONTAINS_SET(m, a) ((m).find((a)) != m.end())
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; exit(0); }
void Yes() { cout << "Yes" << endl; exit(0); }
void No() { cout << "No" << endl; exit(0); }

signed main()
{
	int A, B;
	cin >> A >> B;

	bool is_swap = false;
	if (A < B)
	{
		is_swap = true;
		swap(A, B);
	}

	int sum_a = 0;
	for (int i = 1; i <= A; i++)
	{
		sum_a += i;
	}
	int sum_b = 0;
	for (int i = 1; i <= B; i++)
	{
		sum_b += i;
	}

	int fix = is_swap ? -1 : 1;
	for (int i = 1; i <= A; i++)
	{
		cout << fix * i << " ";
	}
	for (int i = 1; i < B; i++)
	{
		cout << fix  * -i << " ";
	}
	cout << fix * (-B - (sum_a - sum_b)) << " ";
	cout << endl;
}


