#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int exgcd(int a, int b, int &x, int &y) {
  if (!b) {
    x = 1, y = 0;
    return a;
  }
  int d = exgcd(b, a % b, y, x);
  y -= a / b * x;
  return d;
}
int main() {
  int c, d;
  cin >> n >> a >> b;
  if (a == 1 || b == 1) {
    for (int i = 1; i < n; i++) cout << i << " ";
    cout << n << endl;
    return 0;
  }
  int x = 0, y = 0;
  for (int i = 0; i <= n / a; i++) {
    if ((n - a * i) % b == 0) {
      x = i;
      y = (n - a * i) / b;
    }
  }
  if (x == 0 && y == 0) {
    puts("-1");
    return 0;
  }
  int i = 1;
  for (int k = 0; k < x; k++) {
    for (int j = 1; j <= a - 1; j++) cout << i + j << " ";
    cout << i << " ";
    i += a;
  }
  for (int k = 0; k < y; k++) {
    for (int j = 1; j <= b - 1; j++) cout << i + j << " ";
    cout << i << " ";
    i += b;
  }
}
