#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int) n; i++)
using ll = long long;
template <class T>
using vt = vector<T>;
using vvi = vector<vt<int>>;

int my_sum(int n){
  return (1+n)*n/2;
}

void solve(int *E, int a, int b, int k){

  rep(i,k){
    E[i] = i+1;
  }

  int tmp = 0;
  rep(i,a+b-k-1){
    E[i+k] = i+1;
    tmp += i+1;
  }

  E[a+b-1] = my_sum(k) - tmp;

  if (k == a) {
    rep(i,b){
      E[i+k] = -E[i+k];
    }
  } else {
    rep(i,b) {
      E[i] = -E[i];
    }
  }

}

int main(){

  int A,B;
  cin >> A >> B;

  int AB = A + B;
  int E[100000] = {};

  if (A > B) {
    solve(E,A,B,A);
  } else if (B > A) {
    solve(E,A,B,B);
  } else {
    rep(i,A){
      E[i] = i+1;
    }
    rep(i,A+B){
      E[i+A] = -i-1;
    }
  }

  rep(i,AB){
    cout << E[i] << ' ';
  }

  cout << endl;

  return 0;
}

#include <bits/stdc++.h>
using namespace std;
const long long mod1 = 1000000007;
using ll = long long;

long long pow(long x,long n){
    long long ans = 1;
    while(n != 0){
        long long a = x;
        long long z = 1;
        while(z*2 <= n){
            a *=a;
            a=a%mod1;
            z*=2;
        }
        ans*=a;
        ans=ans%mod1;
        n-=z;
    }
    return ans; 
}//累乗 x^n

template<typename T>
void input_vec(vector<T> &A,long long N){
    for(int i = 0; i < N; i++){
        cin >> A.at(i);
    }
    return;
}//入力を配列で受け取る

template<typename T>
void output_vec(vector<T> &A,long long N){
    for(int i = 0; i < N; i++){
        if(i != 0){
            cout << " ";
        }
        cout << A.at(i);
    }
    cout << endl;
    return;
}//配列を出力

template<typename T>
long long count_vec(vector<T> &A,T x){
    long long counter = 0;
    for(int i = 0; i < (int)A.size(); i++){
        if(A.at(i) == x){
            counter++;
        }
    }
    return counter;
}//配列内のxの個数をreturn


vector<char> change_vec(string s,int n){
    vector<char> ans(n);
    for(int i = 0; i < n; i++){
        ans.at(i) = s.at(i);
    }
    return ans;
}//長さがnの文字列を配列に変換

vector<ll> change_vec2(ll x){
    vector<ll> ans;
    while(x != 0){
        ans.push_back(x%10);
        x/=10;
    }
    return ans;
}//数列を配列に変換

ll sort_big(ll x){
    vector<ll> vec = change_vec2(x);
    sort(vec.begin(),vec.end());
    ll ans = 0;
    for(int i = (int)vec.size()-1; i >= 0 ; i--){
        ans += vec.at(i);
        if(i != 0) ans*=10;
    }
    return ans;
    
}//桁ごとに大きい順に並べ替え

ll sort_small(ll x){
    vector<ll> vec = change_vec2(x);
    sort(vec.begin(),vec.end());
    ll ans = 0;
    for(int i = 0; i < (int)vec.size();i++){
        ans += vec.at(i);
        if(i+1 != (int)vec.size()) ans*= 10;
    }
    return ans;
}//桁ごとに小さい順に並べ替え


int main(){
    ll A,B;cin >> A >> B;
    vector<ll> Ea(A);
    vector<ll> Eb(B);
    ll sum = 0;
    ll afinish = 0;
    ll bfinish = 0;
    for(int i = 0; i+1 < A; i++){
        Ea.at(i) = i+1;
        sum+=Ea.at(i);
        afinish = i+1;
    }
    
    for(int i = 0; i+1 < B; i++){
        Eb.at(i) = i*-1-1;
        sum+=Eb.at(i);
        bfinish = i*-1;
    }
    if(A>B){
        Ea.at(A-1) = afinish+1;
        sum+=Ea.at(A-1);
        Eb.at(B-1) = sum*-1;
    }
    else{
        //cout << bfinish << endl;
        Eb.at(B-1) = bfinish-1-1;
        sum += Eb.at(B-1);
        Ea.at(A-1) = sum*-1;
    }
    for(int i = 0; i < A; i++){
        cout << Ea.at(i) << " ";
    }
    for(int i = 0; i < B; i++){
        if(i+1 == B)cout << Eb.at(i) << endl;
        else cout << Eb.at(i) << " ";
    }
    
    
}