#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using dbl = long double;
using pii = pair<int, int>;
int n, a, b;
void print_cycle(int len, int& cur) {
  for (int i = 1; i <= len - 1; i++) printf("%d ", cur + i);
  printf("%d ", cur);
  cur += len;
}
void print_ans(int x, int y) {
  int cur = 1;
  for (int i = 0; i < x; i++) print_cycle(a, cur);
  for (int i = 0; i < y; i++) print_cycle(b, cur);
  printf("\n");
}
void solve() {
  scanf("%d%d%d", &n, &a, &b);
  for (int x = 0; x <= n; x++) {
    ll rem = n - (ll)a * x;
    if (rem < 0 || rem % b != 0) continue;
    int y = rem / b;
    print_ans(x, y);
    return;
  }
  puts("-1");
}
int main() {
  solve();
  (void)0;
}
