#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
inline bool mina(A &first, B second) {
  return (first > second) ? (first = second, 1) : 0;
}
template <class A, class B>
inline bool maxa(A &first, B second) {
  return (first < second) ? (first = second, 1) : 0;
}
const int MAXN = 1e6 + 5;
int N, A, B;
int in[MAXN];
void gen(int start, int first) {
  if (first == 1) {
    in[start] = start;
    return;
  }
  for (int i = 0; (i) < (first - 1); ++(i)) {
    in[start + i + 1] = start + i;
  }
  in[start] = start + first - 1;
}
int main() {
  scanf("%d %d %d", &N, &A, &B);
  for (int i = 0; i * A <= N; i++) {
    if ((N - i * A) % B == 0) {
      int num_a = i;
      int num_b = (N - i * A) / B;
      int start = 1;
      for (int k = 0; (k) < (num_a); ++(k)) {
        gen(start, A);
        start += A;
      }
      for (int k = 0; (k) < (num_b); ++(k)) {
        gen(start, B);
        start += B;
      }
      for (int i = 1; i <= N; i++) {
        cout << in[i] << " ";
      }
      cout << endl;
      return 0;
    }
  }
  printf("-1\n");
  return 0;
}
