#include <bits/stdc++.h>
using namespace std;
vector<bool> mar;
vector<vector<pair<int, int>>> v;
void print(vector<int> v) {
  vector<int>::iterator it = v.begin();
  while (it != v.end()) {
    cout << *it << " ";
    it++;
  }
  cout << endl;
}
struct comp {
  bool operator()(const pair<int, int>& a, const pair<int, int>& b) const {
    if (a.first == b.first) return a.second > b.second;
    return a.first < b.first;
  }
};
double dist(double a1, double b1, double a2, double b2) {
  double x = ((a2 - a1) * (a2 - a1)) + ((b2 - b1) * (b2 - b1));
  x = sqrt(x);
  return x;
}
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  vector<int> ans(n + 1);
  if (a == 1 || b == 1) {
    for (int i = 1; i <= n; i++) {
      cout << i << " ";
    }
    cout << endl;
    return 0;
  }
  int x = 0;
  int y;
  bool deb = 0;
  while ((n - a * x) >= b) {
    if ((n - a * x) % b == 0) {
      y = (n - a * x) / b;
      deb = 1;
      break;
    }
    x++;
  }
  if (deb == 0) {
    y = 0;
    while ((n - b * y) >= a) {
      if ((n - b * y) % a == 0) {
        x = (n - b * y) / a;
        deb = 1;
        break;
      }
      y++;
    }
    if (deb == 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  int idx = 1;
  int st = 1;
  while (x--) {
    int xx = idx;
    while (idx < xx + a - 1) {
      ans[idx] = idx + 1;
      idx++;
    }
    ans[idx] = st;
    idx++;
    st += a;
  }
  while (y--) {
    int yy = idx;
    while (idx < yy + b - 1) {
      ans[idx] = idx + 1;
      idx++;
    }
    ans[idx] = st;
    idx++;
    st += b;
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
