#include <bits/stdc++.h> 
#define F first 
#define S second 
#define MAX 10000003 
using namespace std; 
#define ll long long int
#include<fstream>
#define fast ios_base::sync_with_stdio(false);
#define io   cin.tie(NULL);
#define inp(arr,n) for(ll i=0;i<n;i++){cin>>arr[i];}
#define print(arr,n) for(ll i=0;i<n;i++){cout<<arr[i]<<" ";}
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define MOD 1000000007
ll power(ll a, ll b) { //a^b
	ll res = 1;
	a = a % MOD;
	while (b > 0) {
		if (b & 1) {res = (res * a) % MOD; b--;}
		a = (a * a) % MOD;
		b >>= 1;
	}
	return res;
}
int main()
{
	
	ll t;
	t=1;
	while(t--)
	{
		ll a,b;
		cin>>a>>b;
		if(a>=b)
		{
			for(ll i=1;i<=a;i++)
				cout<<i<<" ";
			for(ll i=1;i<=b-1;i++)
				cout<<-i<<" ";
			ll sum=0;
			for(ll i=b;i<=a;i++)
				sum+=i;
			cout<<-sum<<endl;
		}
		if(a<b)
		{
			for(ll i=1;i<=b;i++)
				cout<<-i<<" ";
			for(ll i=1;i<=a-1;i++)
				cout<<i<<" ";
			ll sum=0;
			for(ll i=a;i<=b;i++)
				sum+=i;
			cout<<sum<<endl;
		}
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#include <set>
//#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define all(v) v.begin(), v.end()
#define front(v) *v.begin()
#define back(v) *(--v.end())
#define len(v) v.size()
#define int long long

using longl = long long;
using longd = long double;

const longl INF = 1e9;
const longl LINF = 1e18;
const longl mod = 1e9 + 7;
const double PI = acos(-1);
//------------------------------------------------------------------------------------------------

longl divup(longl a, longl b){
    return (a + b - 1) / b;
}

longl bin_pow(longl a, longl b){
    longl res = 1;

    while (b > 0){
        if (b % 2)
            res = res * a % mod;

        a = a * a % mod;
        b /= 2;
    }
    return res;
}


//------------------------------------------------------------------------------------------------
int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int a, b;
    cin >> a >> b;
    
    int n;
    int k;
    if (a > b) {
        n = a;
        k = 1;
    }
    else {
        n = b;
        k = -1;
    }

    int sum = 0;
    int sum2 = 0;
    vector<int> tmp;
    for (int i = 0; i < n; i++){
        cout << (i + 1) * k << ' ';
        sum += (i + 1) * k;

        if (i < min(a, b) - 1){
            cout << -((i + 1) * k) << ' ';
        }
        else {
            sum2 += (i + 1) * k;
        }
    }

    cout << -sum2;

    return 0;
}