#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
    int A, B;
    cin >> A >> B;
    vector<int> sum(1001,0);
    for(int i=1; i<=1000; i++){
        sum[i] = sum[i-1] + i;
    }
    if(A==B){
        for(int i=1; i<=A; i++) cout << i << " " << -i << " ";
    }
    else if(A>B){
        for(int i=1; i<=A; i++) cout << i << " ";
        //sum[A]
        int near = 2147483641;
        int left, right;
        for(int i=0; i<=1000-B; i++){
            int j = i + B;
            int diff = sum[A] - (sum[j]-sum[i]);
            if(diff>0){
                near = min(near, diff);
                if(near == diff){
                    left = i;
                    right = j;
                }
            }
        }
        for(int i=left+1; i<right; i++) cout << -i << " ";
        cout << -right - (sum[A] - sum[right] + sum[left]);
    }
    else{
        for(int i=1; i<=B; i++) cout << -i << " ";
        //sum[B]
        int near = 2147483641;
        int left, right;
        for(int i=0; i<=1000-A; i++){
            int j = i + A;
            int diff = sum[B] - (sum[j]-sum[i]);
            if(diff>0){
                near = min(near, diff);
                if(near == diff){
                    left = i;
                    right = j;
                }
            }
        }
        for(int i=left+1; i<right; i++) cout << i << " ";
        cout << right + (sum[B] - sum[right] + sum[left]);
    }
    cout << endl;
}
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, s, n) for (int i = s; i <= (int)(n); i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define vec vector
#define rip return 0
typedef long long ll;
typedef pair<ll,ll> P;
ll max(ll x,ll y){
if(x>y)return x;
else return y;
}
ll min(ll x,ll y){
if(x<y)return x;
else return y;
}

int main(){
  int a,b;
  cin>>a>>b;
  
  if(a%2==0){
    rep(i,a){
      if(i<(a/2))cout<<10000*b+a/2-i<<" ";
      else cout<<10000*b+a/2-i-1<<" ";
    }
  }
  else{
    rep(i,a)cout<<10000*b+a/2-i<<" ";
  }
  if(b%2==0){
    rep(i,b){
      if(i<(b/2))cout<<-10000*a+b/2-i<<" ";
      else cout<<-10000*a+b/2-i-1<<" ";
    }
  }
  else{
    rep(i,b)cout<<-10000*a+b/2-i<<" ";
  }
  cout<<endl;
}