#include <iostream>
using namespace std;
int main(void){
    int A, B;
    cin >> A >> B;
    int sum = 0;
    int i, j;
    for (i = 1; i < A; i++) {
        cout << i << " ";
        sum += i;
    }
    for (j = 1; j < B; j++) {
        cout << -j << " ";
        sum -= j;
    }
    if(sum > 0){
        cout << i << " " << -(sum + i) << endl;
    } else {
        cout << -j << " " << j - sum << endl;
    }
}
/*
Author : DEBAPRIYA CHANDRA 
    [JGEC]

*/

#include<bits/stdc++.h>
#define ll  long long int
#define dbl long double
#define loop(i,n) for(int i=0;i<n;i++)
#define test(t) int t;cin>>t;while(t--)
#define debo ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define vi vector<ll>
#define sz size()
#define iss is_sorted
#define bs binary_search
#define mx INT_MAX
#define mi INT_MIN
#define gcd(a,b)  __gcd(a,b)
#define sw(a,b) swap(a,b)

using namespace std;
bool isPalindrome(string  s,int i,int j)
{
     if(i>j) return true;
     if(s[i]!=s[j]) return false;
     else return isPalindrome( s, i+1, j-1);
}
bool isPrime(ll  n)
{
    if (n <= 1) return false;
    if (n <= 3) return true;
    if (n % 2 == 0 || n % 3 == 0) return false;
    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;
    return true;
}
 signed main(){
     debo;
     ll a,b;
     cin>>a>>b;
     if(a>=b)
     {
         for(ll i=1;i<=a;i++)cout<<i<<" ";
         for(ll i=1;i<b;i++)cout<<-i<<" ";
         ll sum=0;
         for(ll i=b;i<=a;i++){
             sum+=i;
         }
         cout<<-sum<<endl;
     }
     else {
         ll bb[b];
         for(ll i=1;i<a;i++)cout<<i<<" ";
         for(ll i=1;i<=b;i++)bb[i-1]=-i;
         ll sum=0;
         for(ll i=a;i<=b;i++){
             sum+=i;
         }
         cout<<sum<<" ";
         for(ll i=0;i<b;i++)cout<<bb[i]<<" ";
         
     }
     
     return 0;
 }