#include <bits/stdc++.h>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include <numeric>
using namespace std;

typedef long long ll;
#define rep(i,n) for(int i = 0 ; i < n ; i++)
#define Rep(i,n) for(int i = 1 ; i <= n ; i++)
const int maxn=2e5+5;
const ll mod = 1e9 + 7;
const bool DEBUG = 0;

int main(){

    int a,b,ans;

    cin >> a >> b;

    
    int sum = 500500;
    Rep(i,a){
        if( i < a ){
            cout << i << ' ';
            sum = sum - i;
        }else{
            cout << sum << ' ';
        }
    }

    sum = 500500;
    Rep(i,b){
        if( i < b){
            cout << -i << ' ';
            sum = sum - i;
        }else{
            cout << -sum << ' ';
        }
    }
    

    return 0;
}
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
using namespace std;
 
#pragma GCC optimize("O3","unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target("avx2")
 
#define sync ios_base::sync_with_stdio(0); cin.tie(0);
#define all(x) x.begin(),x.end()
#define unq(a) sort(all(a));a.resize(unique(all(a)) - a.begin())
#define ll long long
#define ld long double
#define pb push_back
#define fi first
#define se second
#define endl '\n'
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//mt19937 rng(0);
using pii = pair<int , int>;
 
int inline max(const int x, const int y){return (x > y ? x : y);}
int inline min(const int x, const int y){return (x < y ? x : y);}
int inline abs(const int x){return (x < 0 ? -x : x);}

int main(){
 
    #ifndef ONLINE_JUDGE 
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    sync

    int t = 1;
    //cin >> t;
    while(t--){
      int n, m;
      cin >> n >> m;
      bool f = 0;
      if (n < m){
        swap(n , m);
        f = 1;
      }
      vector<int> a(n), b(m);
      ll sm = 0;
      for (int i = 0; i < n; i++){
        a[i] = i + 1;
        sm += a[i];
      }
      for (int i = 0; i < m - 1; i++){
        b[i] = -(i + 1);
        sm += b[i]; 
      }
      b[m - 1] = -sm;
      for (int i = 0; i < n + m; i++){
        if (i < n){
          cout << a[i] * (f ? -1 : 1) << " ";
        }
        else{
          cout << b[i - n] * (f ? -1 : 1) << " ";
        }
      } cout << endl;
    }
    cerr << "processor time: " << clock() / (double) CLOCKS_PER_SEC << "s    ";
    return 0;
}