#include <bits/stdc++.h>
using namespace std;
inline long long fexp(long long b, long long e) {
  long long x = 1;
  for (; e; e >>= 1, b = (b * b) % (1000000007))
    if (e & 1) x = (x * b) % (1000000007);
  return x;
}
long long l, r, n, a, b, x, y, p[1000006];
long long f(long long i, long long j) { return j == 1 ? p[i] : f(p[i], j - 1); }
long long g(long long i) {
  for (long long j = 1; j <= n; j++) {
    if (f(i, j) == i) return j;
  }
  return -1;
}
void cycle(long long l, long long r) {
  ++l, ++r;
  for (long long i = l; i < r - 1; i++) {
    p[i] = i + 1;
  }
  p[r - 1] = l;
}
signed main() {
  while (cin >> n >> a >> b) {
    y = -1;
    for (x = 0; a * x <= n; x++) {
      if ((n - a * x) % b == 0) {
        y = (n - a * x) / b;
        break;
      }
    }
    if (y == -1) {
      cout << -1 << endl;
      continue;
    }
    for (long long i = 1; i <= n; i++) p[i] = i;
    for (long long i = 0; i < x; i++) {
      l = a * i;
      r = a * (i + 1);
      cycle(l, r);
    }
    for (long long i = 0; i < y; i++) {
      l = a * x + b * i;
      r = a * x + b * (i + 1);
      cycle(l, r);
    }
    for (long long i = 1; i <= n; i++) {
      cout << p[i] << ' ';
    }
    cout << endl;
  }
  return 0;
}
