#include <bits/stdc++.h>
using namespace std;
long long n, a, b, ans[1000111];
int main() {
  scanf("%lld%lld%lld", &n, &a, &b);
  if (a < b) swap(a, b);
  for (long long i = 0; a * i <= n; i++) {
    if ((n - a * i) % b != 0) continue;
    long long ac = i, bc = (n - a * i) / b;
    for (long long i = 0; i < ac; i++) {
      for (long long j = 0; j < a - 1; j++) {
        ans[i * a + j + 1] = i * a + j + 1;
      }
      ans[i * a] = (i + 1) * a;
    }
    long long base = ac * a;
    for (long long i = 0; i < bc; i++) {
      for (long long j = 0; j < b - 1; j++) {
        ans[base + i * b + j + 1] = base + i * b + j + 1;
      }
      ans[base + i * b] = base + (i + 1) * b;
    }
    for (long long i = 0; i < n; i++) printf("%lld ", ans[i]);
    printf("\n");
    return 0;
  }
  printf("-1\n");
}
