#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 0; i <= n && i * a <= n; ++i)
    if ((n - i * a) % b == 0) {
      int l = 1;
      for (int j = 1; j <= i; ++j) {
        int r = l + a - 1;
        for (int k = l + 1; k <= r; ++k) printf("%d ", k);
        printf("%d ", l);
        l += a;
      }
      int L = (n - i * a) / b;
      for (int j = 1; j <= L; ++j) {
        int r = l + b - 1;
        for (int k = l + 1; k <= r; ++k) printf("%d ", k);
        printf("%d ", l);
        l += b;
      }
      return 0;
    }
  puts("-1");
}
