#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b, long long& x, long long& y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1;
  int d = gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  long long x, y;
  int d = gcd(a, b, x, y);
  if (n % d != 0) {
    cout << -1;
    return 0;
  }
  x = (long long)n / d * x;
  y = (long long)n / d * y;
  while (x < 0) {
    x += b / d;
    y -= a / d;
  }
  while (y < 0) {
    y += a / d;
    x -= b / d;
  }
  if (x < 0 || y < 0) {
    cout << -1;
    return 0;
  }
  int ans[n];
  for (int i = 0; i < a * x; i++) {
    if (i % a == a - 1)
      ans[i] = i - a + 1;
    else
      ans[i] = i + 1;
    cout << ans[i] + 1 << ' ';
  }
  for (int i = a * x; i < n; i++) {
    if ((i - a * x) % b == b - 1)
      ans[i] = i - b + 1;
    else
      ans[i] = i + 1;
    cout << ans[i] + 1 << ' ';
  }
  return 0;
}
