#include <bits/stdc++.h>
using namespace std;
long long int n, a, b, p = 1;
vector<long long int> ans;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> a >> b;
  if (a > b) swap(a, b);
  if (n % b == 0) {
    long long int m = n;
    while (m >= b) {
      m -= b;
      for (int i = p; i < p + b - 1; i++) cout << i + 1 << " ";
      cout << p << " ";
      p += b;
    }
    return 0;
  }
  if (n % a == 0) {
    long long int m = n;
    while (m >= a) {
      m -= a;
      for (int i = p; i < p + a - 1; i++) cout << i + 1 << " ";
      cout << p << " ";
      p += a;
    }
    return 0;
  }
  long long int m = n;
  while (m >= b) {
    m -= b;
    for (int i = p; i < p + b - 1; i++) ans.push_back(i + 1);
    ans.push_back(p);
    p += b;
    if (m % a == 0) break;
  }
  while (m >= a) {
    m -= a;
    for (int i = p; i < p + a - 1; i++) ans.push_back(i + 1);
    ans.push_back(p);
    p += a;
  }
  if (m) return cout << -1, 0;
  for (long long int x : ans) cout << x << " ";
  return 0;
}
