#include <bits/stdc++.h>
using namespace std;
long long arr[1000010];
int main() {
  long long n, a, b;
  cin >> n >> a >> b;
  if (a < b) swap(a, b);
  long long mod = n % a;
  if (a == 1 || b == 1) {
    for (long long i = 1; i <= n; i++) cout << i << ' ';
    return 0;
  }
  long long cur = 1;
  long long p = 1;
  long long m = n;
  while (n) {
    long long temp;
    if (n < a && n < b) {
      cout << -1;
      return 0;
    }
    if (n % a == 0)
      temp = a;
    else if (n % b == 0)
      temp = b;
    else
      temp = (a <= n ? a : b);
    arr[cur + temp - 1] = p++;
    for (long long i = cur; i <= cur + temp - 2; i++) {
      arr[i] = p++;
    }
    cur += temp;
    n -= temp;
  }
  for (long long i = 1; i <= m; i++) cout << arr[i] << ' ';
}
