


//---------------------------------------------------------JAI HIND------------------------------------------------------------------------

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define all(a) a.begin(), a.end()
#define Summon_Tourist ios::sync_with_stdio(false); cin.tie(0);
ll inf = 998244353;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll extgcd(ll a, ll b, ll *x, ll *y) { if (b == 0){*x = 0;*y = 1;return a;}ll x1, y1;ll g = extgcd(b, a % b, &x1, &y1);*x = y1 - (a / b) * x1;*y = x1;return g; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll modexp(ll base, ll power){if (power == 0)return 1;if (power & 1)return base * modexp(base, power - 1) % inf;return modexp(base * base % inf, power / 2); }
ll modinv(ll a, ll mod){ ll x, y;ll g = extgcd(a, mod, &x, &y); if (g != 1) return 0; return (y + mod) % mod; }


//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
int main()
{
    Summon_Tourist
    ll t = 1;
    //cin>>t;
    while (t--)
    {
        
        int a,b; cin>>a>>b;
        int which = 1;
        if( b<a ){
            int z = b; 
            b = a,a = z;
            which = 0;
        }

        int avg = b/a,rem = b%a;
        rem = a - rem; 


        vector<int> av,bv;  
        int count = 1; 
        for( int i = 0 ; i<a; i++ ){
            int correspond = 0;
            for( int j = 0 ; j<avg; j++ ){
                bv.emplace_back(count);
                correspond += count; 
                ++count;
                
            }
            if( rem-- <= 0 ){
                bv.emplace_back(count);
                correspond += count;
                ++count;
            }

            av.emplace_back(correspond);

            correspond = 0;
        }

        for( int i = 0 ; i<a; i++ ){
            if( which == 1 ) cout<<av[i]<<" ";
            else cout<<-av[i]<<" ";
        }
        for( int i = 0 ; i<b; i++ ){
            if( which == 1 ) cout<<-bv[i]<<" ";
            else cout<<bv[i]<<" ";
        }



    }
    return 0;
}

//----------------------------------------------------------------------------------------------------------------------------------------------------

#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 4000000000000000000 //オーバーフローに注意
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define SIZE 2005

ll A,B;
ll table[SIZE];

int main(){

	scanf("%lld %lld",&A,&B);

	ll sum = 0;

	for(ll i = 0; i < A; i++){

		table[i] = i+1;
		sum += table[i];
	}

	for(ll i = 0; i < B; i++){

		table[A+i] = -(i+1);
		sum += table[A+i];
	}

	if(sum > 0){

		table[A+B-1] -= sum;

	}else if(sum < 0){

		table[A-1] += abs(sum);
	}

	printf("%lld",table[0]);

	for(ll i = 1; i < A+B; i++){

		printf(" %lld",table[i]);
	}
	printf("\n");

	return 0;
}
