/*** author: yuji9511 ***/
#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
using vll = vector<ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
ostream& operator<<(ostream& os, lpair& h){ os << "(" << h.first << ", " << h.second << ")"; return os;}
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

void solve(){
    ll A,B;
    cin >> A >> B;
    vll ans;
    ll sum = 0;
    if(A <= B){
        rep(i,0,B){
            ans.push_back(-(i+1));
            sum += i+1;
        }
        rep(i,0,A-1){
            ans.push_back(i+1);
            sum -= i+1;
        }
        ans.push_back(sum);

    }else{
        rep(i,0,A){
            ans.push_back((i+1));
            sum += i+1;
        }
        rep(i,0,B-1){
            ans.push_back(-(i+1));
            sum -= i+1;
        }
        ans.push_back(-sum);

    }
    printa(ans, ans.size());


}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
}
#include<bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x){
	x=0;char ch=getchar();bool f=false;
	while(!isdigit(ch)){if(ch=='-'){f=true;}ch=getchar();}
	while(isdigit(ch)){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
	x=f?-x:x;
	return ;
}
template <typename T>
inline void write(T x){
	if(x<0) putchar('-'),x=-x;
	if(x>9) write(x/10);
	putchar(x%10^48);
	return ;
}
const int N=3e5+5;
int n,m;
#define ll long long
int main(){
	read(n),read(m);
	if(n>m){
		for(int i=1;i<=n;i++) cout<<i<<" ";
		for(int i=1;i<=m-1;i++) cout<<-i<<" ";
		cout<<-(n*(n+1)/2-(m-1)*(m)/2);
	}
	else if(m>n){
		for(int i=1;i<=n-1;i++) cout<<i<<" ";
		for(int i=1;i<=m;i++) cout<<-i<<" ";
		cout<<-((n)*(n-1)/2-(m+1)*m/2);
	}
	else for(int i=1;i<=n;i++) cout<<i<<" "<<-i<<" ";
	return 0;
}
