#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    int n, m, i, j, k;
    int a, b;
    cin >> n >> a >> b;
    int u, v;
    for (u = 0; u * a <= n; u++)
      if ((n - u * a) % b == 0) {
        v = (n - u * a) / b;
        break;
      }
    if (u * a > n) {
      cout << -1 << endl;
      continue;
    }
    i = 1;
    while (u--) {
      k = i;
      for (k = i + 1; k <= i + a - 1; k++) cout << k << " ";
      cout << i << " ";
      i += a;
    }
    while (v--) {
      k = i;
      for (k = i + 1; k <= i + b - 1; k++) cout << k << " ";
      cout << i << " ";
      i += b;
    }
    cout << endl;
  }
}
