#include<bits/stdc++.h>
#define ll long long int
#define pll pair<ll,ll>
#define vpll vector< pll >
#define mpll map<ll,ll>
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define s(v) v.size()
#define test ll t;cin>>t;while(t--)
#define vec vector<ll>
#define read0(v,n) for(int i=0;i<n;i++)cin>>v[i];
#define read1(v,n) for(int i=1;i<=n;i++)cin>>v[i];
#define trav(a,x) for (auto& a: x)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define cut(x) {cout<<x;return 0;}
#define print(x) {cout<<x<<nl;continue;}
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORB(i,a,b) for(int i=a;i>=b;i--)
#define err1(a) {cout<<#a<<' '<<a<<nl;}
#define err2(a,b) {cout<<#a<<' '<<a<<' '<<#b<<' '<<b<<nl;}

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define f first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define nl '\n'
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
#define oset tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
ll gcd(ll a, ll b)
{
	if (b==0)return a;
	return gcd(b, a % b);
}
ll lcm(ll a,ll b)
{
    return (a*b)/gcd(a,b);
}
ll bpow(ll a, ll b)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%MOD;
		b/=2;
		a=(a*a)%MOD;
	}
	return ans;
}

int main()
{
	#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    	#endif

	fast
	ll a,b;
	cin>>a>>b;
    if(a==b)
    {
        FOR(i,1,a)cout<<-i<<' '<<i<<' ';
        return 0;
    }
    if(a>b)
    {
        FOR(i,1,b-1)cout<<i<<' '<<-i<<' ';
        ll sum=0;
        FOR(i,b,a)
        {
            cout<<i<<' ';
            sum+=i;
        }
        cout<<-sum;
    }
    else
    {
        FOR(i,1,a-1)cout<<i<<' '<<-i<<' ';
        ll sum=0;
        FOR(i,a,b){sum+=i;cout<<-i<<' ';}
        cout<<sum;
    }
}

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define e "\n"
#define fl(x,n) for(ll i=x;i<=n;i++)
#define fl2(x,n) for(ll i=x;i>=n;i--)
using namespace std;

int main()
{

       ios_base::sync_with_stdio(false);
       cin.tie(NULL);
        int a,b;
        cin >> a >> b;
        if(a>b)
        {
            ll s1=(a*(a+1))/2;
            b--;
            ll s2=(b*(b+1))/2;
            fl(1,a)
            cout << i << " ";
            fl(1,b)
            cout << -i << " ";
           ll temp=s1-s2;
           cout << -temp << e;
        }
        else if(a<b)
        {
             ll s1=(b*(b+1))/2;
             a--;
            ll s2=(a*(a+1))/2;
            fl(1,b)
            cout << -i << " ";
            fl(1,a)
            cout << i << " ";
           ll temp=s1-s2;
           cout << temp << e;
        }
        else
        {
            fl(1,a)
            cout << i << " ";
            fl(1,b)
            cout << -i << " ";
            cout << e;

        }



       return 0;
}
