#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
int a[maxn];
int main() {
  int n, A, B, sum1 = 0, sum2 = 0, flag = 0;
  cin >> n >> A >> B;
  if (A > B) swap(A, B);
  for (int i = 1; i <= n; i++) a[i] = i;
  for (int i = 0; i <= n; i++) {
    sum1 = i;
    sum2 = n - i;
    if (sum1 % A == 0 && sum2 % B == 0) {
      flag = 1;
      break;
    }
  }
  if (!flag)
    cout << "-1" << endl;
  else {
    int all = 1;
    for (int i = 1; i <= sum1 - 1; i++) {
      if (all == A) continue;
      swap(a[i], a[i + 1]);
      all++;
      if (all == A) i++, all = 1;
    }
    all = 1;
    for (int i = sum1 + 1; i <= n - 1; i++) {
      if (all == B) continue;
      swap(a[i], a[i + 1]);
      all++;
      if (all == B) i++, all = 1;
    }
    for (int i = 1; i <= n; i++) {
      if (i == n)
        cout << a[i] << endl;
      else
        cout << a[i] << ' ';
    }
  }
  return 0;
}
