#include <bits/stdc++.h>
using namespace std;
pair<pair<long long int, long long int>, long long int> bezout(
    long long int a, long long int b) {
  long long int s, t, r, old_s, old_t, old_r;
  s = 0;
  t = 1;
  r = b;
  old_s = 1;
  old_t = 0;
  old_r = a;
  while (r != 0) {
    long long int q = old_r / r;
    long long int tmp = r;
    r = old_r - q * r;
    old_r = tmp;
    tmp = s;
    s = old_s - q * s;
    old_s = tmp;
    tmp = t;
    t = old_t - q * t;
    old_t = tmp;
  }
  return {{old_s, old_t}, old_r};
}
vector<long long int> build_cycle(long long int n) {
  vector<long long int> c(n);
  for (long long int i = 0; i < n; i++) {
    c[i] = (i + 1) % n;
  }
  return c;
}
void apply_cycle(long long int start, vector<long long int> &src,
                 long long int n) {
  long long int original = src[start];
  for (long long int i = 0; i < n - 1; i++) {
    src[i + start] = src[i + 1 + start];
  }
  src[n - 1 + start] = original;
}
int main() {
  long long int n, a, b;
  scanf("%lld%lld%lld", &n, &a, &b);
  long long int x, y;
  auto p = bezout(a, b);
  x = p.first.first;
  y = p.first.second;
  long long int r = abs(p.second);
  if (n % r != 0) {
    printf("-1\n");
    return 0;
  }
  long long int u = a / r;
  long long int v = b / r;
  x *= n / r;
  y *= n / r;
  long long int sum = x < 0 ? 1 : 0;
  long long int k = x % v == 0 ? (-x) / v : (-x) / v + sum;
  k = max(k, y % u == 0 ? y / u : y / u - 1);
  x += k * v;
  y -= k * u;
  if (x < 0 || y < 0) {
    printf("-1\n");
    return 0;
  }
  vector<long long int> src(n);
  for (long long int i = 0; i < n; i++) src[i] = i;
  for (long long int i = 0; i < x; i++) {
    apply_cycle(i * a, src, a);
  }
  for (long long int i = 0; i < y; i++) {
    apply_cycle(x * a + i * b, src, b);
  }
  for (long long int i = 0; i < n - 1; i++) {
    printf("%lld ", src[i] + 1);
  }
  printf("%lld\n", src[n - 1] + 1);
  return 0;
}
