#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const int maxlen = (int)(1e5) + 10;
const int base = (int)(1e9);
const long long mod = base;
const long long bigmod = 99194853094755497ll;
const long long infinity = (long long)1e18;
int p[1000010] = {0};
int main() {
  int n, a, b, u, v;
  scanf("%d %d %d", &n, &a, &b);
  u = 0;
  v = -1;
  for (; u * a <= n; u++) {
    int by = n - a * u;
    if (by % b != 0) continue;
    by /= b;
    v = by;
    break;
  }
  if (u < 0 || v < 0) {
    printf("-1");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (u == 0) break;
    if (p[i] != 0) continue;
    for (int j = i; j < i + a - 1; j++) p[j] = j + 1;
    p[i + a - 1] = i;
    u--;
  }
  for (int i = 1; i <= n; i++) {
    if (v == 0) break;
    if (p[i]) continue;
    for (int j = i; j < i + b - 1; j++) p[j] = j + 1;
    p[i + b - 1] = i;
    v--;
  }
  for (int i = 1; i <= n; i++) printf("%d ", p[i]);
  return 0;
}
