#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
int ans[MAXN];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n, a, b;
  cin >> n >> a >> b;
  int aa, bb;
  bool f = 1;
  for (int i = 0; i <= n / a; i++) {
    if (((n - a * i) % b) == 0) {
      aa = i;
      bb = (n - a * i) / b;
      f = 0;
      break;
    }
  }
  if (f) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) ans[i] = i;
  int cur = 0;
  for (int i = 0; i < aa; i++) {
    int nt = cur + a;
    for (int j = nt; j > cur + 1; j--) ans[j] = ans[j - 1];
    ans[cur + 1] = nt;
    cur = nt;
  }
  for (int i = 0; i < bb; i++) {
    int nt = cur + b;
    for (int j = nt; j > cur + 1; j--) ans[j] = ans[j - 1];
    ans[cur + 1] = nt;
    cur = nt;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
