// UpS0lver
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>  // Including tree_order_statistics_node_update

using namespace __gnu_pbds;
using namespace std;

#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(), (c).end()
#define tr(c, i) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x) ((c).find(x) != (c).end())
#define cpresent(c, x) (find(all(c), x) != (c).end())
#define minei(x) min_element(x.begin(), x.end()) - (x).begin()
#define maxei(x) max_element(x.begin(), x.end()) - (x).begin()
#define LSOne(S) (S & (-S))

#define uns(v) sort((v).begin(), (v).end()), v.erase(unique(v.begin(), v.end()), v.end())
#define acusum(x) accumulate(x.begin(), x.end(), 0)
#define acumul(x) accumulate(x.begin(), x.end(), 1, multiplies<int>());
#define bits(x) __builtin_popcount(x)
#define inf 1000000000
#define MAXN 1000007
#define MOD 1000000007
#define debug(x) cerr << (#x) << " = " << (x) << '\n';

const double pi = acos(-1.0);
const double eps = 1e-11;

template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;

typedef long long ll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

void add(int &a, int b) {
    a += b;
    if (a >= MOD) a -= MOD;
}

void pv(vector<ll> v) {
    if (v.empty()) return;
    cout << v[0];
    for (int i = 1; i < sz(v); i++) {
        cout << " " << v[i];
    }
    cout << '\n';
}
ll gtSum(ll n) {
    return n * (n + 1) / 2;
}
void _run_test() {
    int a, b;
    vector<ll> res;
    cin >> a >> b;
    ll cur = 1;
    if (a == b) {
        while (a--) {
            res.pb(cur);
            res.pb(-1 * cur);
            cur++;
        }

    } else if (a > b) {
        for (int i = 0; i < b - 1; i++) {
            res.pb(cur);
            res.pb(-1 * cur);
            cur++;
        }
        res.pb(-1 * (gtSum(a) - gtSum(b - 1)));
        for (int i = b - 1; i < a; i++) {
            res.pb(cur++);
        }

    } else {
        for (int i = 0; i < a - 1; i++) {
            res.pb(cur);
            res.pb(-1 * cur);
            cur++;
        }
        res.pb((gtSum(b) - gtSum(a - 1)));
        for (int i = a - 1; i < b; i++) {
            res.pb(-1 * cur);
            cur++;
        }
    }
    pv(res);
}
int main() {
    std::ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    // cin >> t;
    while (t--) {
        _run_test();
    }

    return 0;
}

#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define replr(i, l, r) for (int i = (l); i < (r); ++i)
const int mod = 1e9 + 7;
int main() {
    int a, b;
    cin >> a >> b;
    int aa = 1, bb = -1;
    if (a < b)
        swap(a, b), swap(aa, bb);
    vector<int> A(a);
    A[0] = 1;
    rep(i, a - 1) { A[i + 1] = A[i] + 1; }
    int sum = 0;
    replr(i, b - 1, a) sum += A[i];

    rep(i, a) {
        if (i < b - 1)
            cout << bb * A[i] << " ";
        cout << aa * A[i] << " ";
    }
    cout << bb * sum << endl;

    return 0;
}