#include <bits/stdc++.h>
using namespace std;
const long long int INF = (1LL << 60) - 1;
const long long int MAX = 1000001;
long long int fast_exp(long long int base, long long int exp, long long int m) {
  long long int res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) {
      res = (res * base) % m;
    }
    base = (base * base) % m;
    exp /= 2;
  }
  return res % m;
}
typedef struct node {
  long long int k, l;
} node;
bool comp(struct node &a, struct node &b) {
  if (a.k == b.k) return a.l > b.l;
  return a.k > b.k;
}
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, a, b, a1 = -1, a2 = -1, start = 0, end = 0;
  cin >> n >> a >> b;
  int p[n + 1];
  for (int i = 0; i < MAX; i++) {
    if ((n - a * i) < 0) break;
    if ((n - (a * i)) % b == 0) {
      a1 = i;
      a2 = (n - (a * i)) / b;
      break;
    }
  }
  if (a1 == -1 && a2 == -1) {
    cout << -1 << endl;
    return 0;
  }
  if (a1 != -1 && a1 != 0) {
    for (int i = 1; i <= a1; i++) {
      start = a * (i - 1);
      for (int j = start + 1; j < a + start; j++) {
        p[j] = j + 1;
      }
      p[a + start] = start + 1;
    }
  }
  if (a2 != -1 && a2 != 0) {
    for (int i = 1; i <= a2; i++) {
      end = b * (i - 1) + a1 * a;
      for (int j = end + 1; j < b + end; j++) {
        p[j] = j + 1;
      }
      p[b + end] = end + 1;
    }
  }
  for (int i = 1; i <= n; i++) cout << p[i] << " ";
  cout << endl;
  return 0;
}
