#include <bits/stdc++.h>
using namespace std;
void inout() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
}
void solve() {
  long long n, a, b, i, j, l = 0;
  cin >> n >> a >> b;
  if (b < a) swap(a, b);
  vector<long long> ans(n + 1);
  for (i = 1; i <= n; i++) {
    ans[i] = i;
    if (i % a == 0 && (n - i) % b == 0) l = i;
  }
  if (!l && (n % b)) {
    cout << -1;
    return;
  }
  i = 1;
  while (i <= l) {
    j = i + 1;
    while (j < i + a) ans[j] = j - 1, j++;
    ans[i] = i + a - 1;
    i += a;
  }
  while (i <= n) {
    j = i + 1;
    while (j < i + b) ans[j] = j - 1, j++;
    ans[i] = i + b - 1;
    i += b;
  }
  for (i = 1; i <= n; i++) cout << ans[i] << " ";
}
int main() {
  inout();
  solve();
  return 0;
}
