#include <bits/stdc++.h>
using namespace std;
const int inf = ~0u >> 1, mod = 1e9 + 7;
inline int rd() {
  int x, c, f = 1;
  while (!isdigit(c = getchar())) f = c != '-';
  x = c - '0';
  while (isdigit(c = getchar())) x = x * 10 + c - '0';
  return f ? x : -x;
}
int n, a, b;
inline void work(int l, int r) {
  for (int i = (l + 1), i_end = (r); i <= i_end; ++i) printf("%d ", i);
  printf("%d ", l);
}
int main() {
  n = rd(), a = rd(), b = rd();
  int t = 0;
  for (int i = (0), i_end = (n / a); i <= i_end; ++i) {
    t = n - a * i;
    if (t % b == 0) {
      for (int j = (1), j_end = (i); j <= j_end; ++j) {
        work((j - 1) * a + 1, j * a);
      }
      int q = a * i;
      for (int j = (1), j_end = (t / b); j <= j_end; ++j) {
        work((j - 1) * b + 1 + q, j * b + q);
      }
      return 0;
    }
  }
  cout << -1 << endl;
}
