#include <bits/stdc++.h>
using namespace std;
using  ll  = long long;
using Graph = vector<vector<int>>;
using VP = vector<pair<long long, long long>>;




ll A,B;

int main(){ 
    cin >> A >> B;
    ll E[A+B];
    ll sum1 = 0,sum2 = 0;
    if(A >= B) { 
        for(int i = 1; i <= A; ++i) { 
            E[i] = i;
            sum1 += i;
        }
        for(int i = 1; i < B; ++i) { 
            E[A + i] = -i;
            sum2 += i;
        }
        E[A+B] = -(sum1-sum2); 
        for(int i = 1; i <= A+B; ++i){ 
          cout << E[i] << " ";
        }
        cout << endl;
    }else { 

        for(int i = 1; i <= B; ++i) { 
            E[i] = -i;
            sum1+=E[i];
        }
        for(int i = 1; i < A; ++i) { 
            E[B + i] = i;
            sum2 += E[i];
        }
        E[A+B] = -(sum1 - sum2);
        for(int i = 1; i <= A+B; ++i){ 
          cout << E[i] << " ";
        }
        cout << endl;
    }
    return 0;
}
//xhxh
//LYC_music yyds!
#include<bits/stdc++.h>
#define int long long
using namespace std;
int read()
{
	int pos=1,num=0;
	char ch=getchar();
	while (!isdigit(ch))
	{
		if (ch=='-') pos=-1;
		ch=getchar();
	}
	while (isdigit(ch))
	{
		num=num*10+(int)(ch-'0');
		ch=getchar();
	}
	return pos*num;
}
void write(int x)
{
	if (x<0)
	{
		putchar('-');
		write(-x);
		return;
	}
	if (x>=10) write(x/10);
	putchar(x%10+'0');
}
void writesp(int x)
{
	write(x);
	putchar(' ');
}
void writeln(int x)
{
	write(x);
	putchar('\n');
}
int A,B,sum;
signed main()
{
	A=read(); B=read();
	sum=A-B;
	if (sum==0)
	{
		for (int i=1;i<=A;i++)
		{
			writesp(i);
			writesp(-i);
		}
		return 0;
	}
	if (sum>0)
	{
		for (int i=1;i<=A;i++)
		{
			writesp(i);
		}
		for (int i=1;i<B;i++)
		{
			writesp(-i);
		}
		write(-(A*(A+1)/2-(B-1)*B/2));
		return 0;
	}
	for (int i=1;i<=B;i++)
	{
		writesp(-i);
	}
	for (int i=1;i<A;i++)
	{
		writesp(i);
	}
	write((B+1)*B/2-(A-1)*A/2);
}