#include <bits/stdc++.h>
using namespace std;
const int N = 1000006;
long long n, a, b, arr[N], cnta, cntb;
bool ans = false;
int main() {
  scanf("%lld", &n);
  ;
  scanf("%lld", &a);
  ;
  scanf("%lld", &b);
  ;
  for (int(i) = (0); (i) <= (int)(n); ++(i)) {
    cnta = i, cntb = n - i;
    if (cnta % a == 0 && cntb % b == 0) {
      ans = true;
      break;
    }
    cnta = n - i, cntb = i;
    if (cnta % a == 0 && cntb % b == 0) {
      ans = true;
      break;
    }
  }
  if (!ans) return cout << -1 << endl, 0;
  int cnt = 1;
  while (cnta) {
    for (int(i) = (cnt + 1); (i) <= (int)(cnt + a - 1); ++(i)) cout << i << " ";
    cout << cnt << " ";
    cnt += a;
    cnta -= a;
  }
  while (cntb) {
    for (int(i) = (cnt + 1); (i) <= (int)(cnt + b - 1); ++(i)) cout << i << " ";
    cout << cnt << " ";
    cnt += b;
    cntb -= b;
  }
  return 0;
}
