#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__);fflush(stderr);
#else
	#define eprintf(...) 42
#endif

using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template<typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
	return (ull)rng() % B;
}

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second

clock_t startTime;
double getCurrentTime() {
	return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}

int main()
{
	startTime = clock();
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int A, B;
	scanf("%d%d", &A, &B);
	int S = A * (A + 1) / 2 - B * (B + 1) / 2;
	for (int i = 1; i <= A; i++) {
		int x = i;
		if (i == A && S < 0) x -= S;
		printf("%d ", x);
	}
	for (int i = 1; i <= B; i++) {
		int x = -i;
		if (i == B && S > 0) x -= S;
		printf("%d ", x);
	}
	printf("\n");

	return 0;
}

#include <iostream>
using namespace std;
#include<bits/stdc++.h>
typedef long long ll;


int main() {
    // int t;
    // cin>>t;
    // while(t--){
        ll i,j,k,l;
        ll x,y,z;
        ll n;
       ll m;cin>>n>>m;
       vector<ll>a(n);
       vector<ll>b(m);
       k=1;
       l=-1;
       if(n==m){
           for(i=0;i<n;i++){
           a[i]=k;
           b[i]=l;
           k++;l--;
           }
       }
       else if(n>m){
           ll s=0,s1=0;;
           for(i=0;i<n;i++){
               a[i]=k;k++;s+=a[i];
           }
           for(i=0;i<m-1;i++){
               b[i]=l;l--;s1-=b[i];
           }
           j=s-s1;
           b[m-1]=-j;
       }
       else{
            ll s=0,s1=0;;
           for(i=0;i<n-1;i++){
               a[i]=k;k++;s+=a[i];
           }
           for(i=0;i<m;i++){
               b[i]=l;l--;s1-=b[i];
           }
           j=s1-s;
           a[n-1]=j;
       }
       for(i=0;i<n;i++)
       cout<<a[i]<<" ";
       for(i=0;i<m;i++)
       cout<<b[i]<<" ";
    // }
	return 0;
}
