#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
//using namespace __gnu_pbds;
//Arr.find_by_order(k-1):kth smallest
//Arr.order_of_key(X):no. of elements less than x
#define int long long 
#define ld long double
#define dob double
#define pb push_back
#define tle ios_base::sync_with_stdio(false);cin.tie(NULL);
const int hell=1e9+7;
#define maxheap priority_queue<int>
#define minheap priority_queue<int, vector<int>, greater<int>>
int inf=1e18;
const int N=1e5+9;
//getline(cin,st);   To Take Entire Sentence In Input; 
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

bool prime(int n)
{
        for( int i=2;i*i<=n;i++)
        {
                if(n%i==0)
                return false;
        }
        return true;
}


int power(int a,int b,int m)
{
	int ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
} 



 
int32_t main()
{
	tle
	int t=1;
	// cin>>t;
	//precompute();
	
	while(t--)
	{
		int a,b;
		cin>>a>>b;
		
		if(a>b)
		{
			for(int i=1;i<=a;i++)
			cout<<i<<" ";
			
			int sum=a*(a+1)/2;
			
			int newsum=b*(b-1)/2;
			int diff=sum-newsum;
			cout<<-1*diff<<" ";
			
			for(int i=1;i<b;i++)
			cout<<-1*i<<" ";
		}
		
		if(a<b)
		{
			for(int i=1;i<=b;i++)
			cout<<-1*i<<" ";
			
			int sum=b*(b+1)/2;
			
			int newsum=a*(a-1)/2;
			int diff=sum-newsum;
			cout<<diff<<" ";
			
			for(int i=1;i<a;i++)
			cout<<i<<" ";
		}
		
		if(a==b)
		{
			for(int i=1;i<=a;i++)
			cout<<i<<" "<<-1*i<<" ";
		}
		
		
	   
	}
	
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rept(i,n) for(int i=1;i<(int)(n);i++)
using intt = int64_t;
using ldou = long double;
int gcd(int a,int b){if(a%b==0){return b;}else{return gcd(b,a%b);}}
int lcm(int a,int b){return a*b/gcd(a,b);}
intt sum(const long &a,const long &b){return(a+b)*(b-a+1)/2;}
int main() {
cout << fixed << setprecision(20);
int a,b;
cin>>a>>b;
vector<int>aa(a);
vector<int>bb(b);
int x=0,y=0;
rep(i,a){
    aa.at(i)=i+1;
    x+=aa.at(i);
}
rep(i,b){
    bb.at(i)=i+1;
    y+=bb.at(i);
}
if(x>y){
    bb.at(b-1)+=x-y;
}
else {
    aa.at(a-1)+=y-x;
}
rep(i,a){
    cout<<aa.at(i)<<" ";
}
rep(i,b){
    cout<<-bb.at(i)<<" ";
}
}
/*

g++ c.cpp
./a.out

*/