#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int a,b;
    cin >> a >> b;
    vector <int> A(a),B(b);
    for(int i=0;i<a;i++)A[i]=i+1;
    for(int i=0;i<b;i++)B[i]=-(i+1);
    if(a>b){
        B[b-1]=-((a*(a+1)/2)-((b*(b-1)/2)));
    }
    if(b>a){
        A[a-1]=(b*(b+1)/2)-(a*(a-1)/2);
    }
    for(int i=0;i<a;i++)cout << A[i] << " ";
    for(int i=0;i<b;i++)cout << B[i] << " ";
}
#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
typedef pair<int, int> II;

const int MAXN = 1000 + 10;
int n, m, a[MAXN], b[MAXN];

int main() {
    scanf("%d%d", &n, &m);

    int rev = 0;
    if (n < m) {
        rev = 1;
        swap(n, m);
    }

    for (int i = 1; i <= n; ++i) {
        a[i] = i;
    }
    for (int i = 1; i <= m; ++i) {
        b[i] = i;
    }

    int sum = 0;
    for (int i = 1; i <= n; ++i) {
        sum += a[i];
    }
    for (int i = 1; i <= m; ++i) {
        sum -= b[i];
    }

    for (int i = 1; i <= m; ++i) {
        b[i] += sum / m;
    }
    b[m] += sum % m;

    if (rev == 0) {
        for (int i = 1; i <= m; ++i) {
            b[i] = -b[i];
        }
    } else {
        for (int i = 1; i <= n; ++i) {
            a[i] = -a[i];
        }
    }

    for (int i = 1; i <= n; ++i) {
        printf("%d ", a[i]);
    }
    for (int i = 1; i <= m; ++i) {
        printf("%d ", b[i]);
    }
    puts("");
    return 0;
}