#include <bits/stdc++.h>
using namespace std;
int n, a, b, x, y, f[1000001];
void make(int l, int r) {
  for (int i = l; i < r; i++) f[i] = i + 1;
  f[r] = l;
}
int main() {
  scanf("%d%d%d", &n, &a, &b);
  for (x = 0; x * a <= n; x++)
    if ((n - x * a) % b == 0) {
      y = (n - x * a) / b;
      break;
    }
  if (a * x + b * y != n) return printf("-1\n"), 0;
  for (int i = 1; i <= x; i++) make(i * a - a + 1, i * a);
  for (int i = 1; i <= y; i++) make(a * x + i * b - b + 1, a * x + i * b);
  for (int i = 1; i <= n; i++) printf("%d%c", f[i], i < n ? ' ' : '\n');
  return 0;
}
