#include <bits/stdc++.h>
using namespace std;
inline long long max(long long x, long long y) { return x > y ? x : y; }
inline long long min(long long x, long long y) { return x < y ? x : y; }
inline long long read() {
  long long x = 0;
  int ch = getchar(), f = 1;
  while (!isdigit(ch) && (ch != '-') && (ch != EOF)) ch = getchar();
  if (ch == '-') {
    f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, a, b, A, B, ans[1000010];
int main() {
  n = read(), a = read(), b = read();
  int l = n / a;
  for (register int i = (0); i <= (l); i++)
    if ((n - i * a) % b == 0) {
      A = i, B = (n - i * a) / b;
      break;
    }
  if (!A && !B) return printf("-1"), 0;
  for (register int i = (1); i <= (A); i++) {
    for (register int j = ((i - 1) * a + 2); j <= (i * a); j++) ans[j] = j - 1;
    ans[(i - 1) * a + 1] = i * a;
  }
  int k = A * a;
  for (register int i = (1); i <= (B); i++) {
    for (register int j = (k + (i - 1) * b + 2); j <= (k + i * b); j++)
      ans[j] = j - 1;
    ans[k + (i - 1) * b + 1] = k + i * b;
  }
  for (register int i = (1); i <= (n); i++) printf("%d ", ans[i]);
}
