#include <bits/stdc++.h>
inline long long MAX2(long long a, long long int b) {
  return (a) > (b) ? (a) : (b);
}
inline long long MAX3(long long a, long long b, long long c) {
  return (a) > (b) ? ((a) > (c) ? (a) : (c)) : ((b) > (c) ? (b) : (c));
}
inline long long MIN2(long long a, long long b) {
  return (a) < (b) ? (a) : (b);
}
inline long long MIN3(long long a, long long b, long long c) {
  return (a) < (b) ? ((a) < (c) ? (a) : (c)) : ((b) < (c) ? (b) : (c));
}
using namespace std;
int n, a, b;
int p[1000006];
pair<int, int> compute() {
  if (n % b == 0) return pair<int, int>(0, n / b);
  if (n % a == 0) return pair<int, int>(n / a, 0);
  int div = (n / b);
  int rem = (n % b);
  int ch;
  while (div > 0) {
    ch = rem % a;
    if (ch == 0) break;
    div--;
    rem += b;
  }
  if (div == 0) return pair<int, int>(-1, -1);
  return pair<int, int>((rem / a), div);
}
void make(int i, int j) {
  int k;
  for (k = i; k < j; k++) {
    p[k] = k + 1;
  }
  p[j] = i;
}
int main() {
  cin >> n >> a >> b;
  if (a > b) {
    int temp = a;
    a = b;
    b = temp;
  }
  pair<int, int> cycles = compute();
  if (cycles.first == -1) {
    cout << -1;
    return 0;
  }
  int i = 1;
  while (i <= n) {
    if (cycles.first > 0) {
      make(i, i + a - 1);
      cycles.first--;
      i += a;
    } else {
      make(i, i + b - 1);
      cycles.second--;
      i += b;
    }
  }
  for (i = 1; i < n + 1; i++) {
    cout << p[i] << " ";
  }
}
