#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
const int N = 2000005;
long long n, A, B, x, y;
int p[N];
int main() {
  scanf("%lld%lld%lld", &n, &A, &B);
  y = -1;
  for (; x * A <= n; ++x) {
    long long tmp = n - x * A;
    if (tmp / B * B == tmp) {
      y = tmp / B;
      break;
    }
  }
  if (y == -1) return 0 * printf("-1\n");
  int i = 1;
  while (x--) {
    int ti = i;
    p[ti + A - 1] = i;
    for (int ci = 1; ci <= A; ++ci) {
      if (ci < A) p[i] = i + 1;
      ++i;
    }
  }
  while (y--) {
    int ti = i;
    p[ti + B - 1] = i;
    for (int ci = 1; ci <= B; ++ci) {
      if (ci < B) p[i] = i + 1;
      ++i;
    }
  }
  for (int i = 1; i <= n; ++i) printf("%d ", p[i]);
  return 0;
}
