#include <bits/stdc++.h>
using namespace std;
int n, a, b, ans[1000106];
void solve(int x, int y) {
  int pos = 1, cont;
  while (x--) {
    cont = a;
    while (cont--) {
      if (!cont)
        ans[pos] = pos - a + 1;
      else
        ans[pos] = pos + 1;
      pos++;
    }
  }
  while (y--) {
    cont = b;
    while (cont--) {
      if (!cont)
        ans[pos] = pos - b + 1;
      else
        ans[pos] = pos + 1;
      pos++;
    }
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> a >> b;
  for (int i = 0; i <= n; i += a) {
    if ((n - i) % b == 0) {
      solve(i / a, (n - i) / b);
      for (int i = 1; i < n + 1; i++) cout << ans[i] << " ";
      cout << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}
