#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int n, a, b, p[1000008];
inline void print(int x, int y) {
  int tmp = 0;
  for (int t = 1; t <= x; ++t) {
    for (int i = 1; i < a; ++i) {
      p[tmp + i] = tmp + i + 1;
    }
    p[tmp + a] = tmp + 1;
    tmp = tmp + a;
  }
  for (int t = 1; t <= y; ++t) {
    for (int i = 1; i < b; ++i) {
      p[tmp + i] = tmp + i + 1;
    }
    p[tmp + b] = tmp + 1;
    tmp = tmp + b;
  }
  for (int i = 1; i <= n; ++i) {
    printf("%d ", p[i]);
  }
}
int main() {
  cin >> n >> a >> b;
  if (a < b) swap(a, b);
  for (int i = 0; i <= n / a; ++i) {
    if ((n - i * a) % b == 0) {
      print(i, (n - i * a) / b);
      return 0;
    }
  }
  puts("-1");
  return 0;
}
