#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> ans(n);
  int a, b;
  cin >> a >> b;
  int cur = 0;
  int c = n;
  while (c > 0) {
    if (c % b == 0) {
      while (c > 0) {
        for (int i = cur; i < cur + b; i++) {
          ans[i] = i + 2;
        }
        ans[cur + b - 1] = cur + 1;
        cur += b;
        c -= b;
      }
    } else {
      bool ex = false;
      for (int i = cur; i < cur + a; i++) {
        if (i >= n) {
          cout << -1;
          return 0;
        }
        ans[i] = i + 2;
      }
      ans[cur + a - 1] = cur + 1;
      cur += a;
      c -= a;
    }
  }
  if (c == 0)
    for (int i = 0; i < n; i++) {
      cout << ans[i] << ' ';
    }
  else
    cout << -1;
  return 0;
}
