#include <bits/stdc++.h>
using namespace std;
const int MX = 1e9 + 1;
const int Imp = -1;
const int INF = 1e7 + 100;
const int N = 1e6 + 5;
const int M = 1e5 + 5;
int X[] = {1, -1, 0, 0};
int Y[] = {0, 0, 1, -1};
int main() {
  int n, a, b, time = 1;
  cin >> n >> a >> b;
  for (int i = 0; i * a <= n; ++i) {
    if ((n - (i * a)) % b == 0) {
      for (int j = 0; j < i; ++j) {
        for (int q = 1; q < a; ++q) {
          ++time;
          cout << time << " ";
        }
        cout << time - a + 1 << " ";
        ++time;
      }
      for (int j = 0; j < (n - (i * a)) / b; ++j) {
        for (int q = 1; q < b; ++q) {
          ++time;
          cout << time << " ";
        }
        cout << time - b + 1 << " ";
        ++time;
      }
      return 0;
    }
  }
  cout << -1;
}
