from copy import deepcopy def main(): N, D, K = map(int, input().split()) dp_table = [[[0 for _ in range(K+1)] for _ in range(D+1)] for _ in range(N+1)] for n in range(N+1): dp_table[n][0][0] = 1 for n in range(1, N+1): for d in range(1, D+1): for k in range(1, K+1): dp_table[n][d][k] = dp_table[n-1][d][k] if d >= n: dp_table[n][d][k] += dp_table[n-1][d-n][k-1] def _get_pattern_by_stack(element: list) -> int: return dp_table[element[0]][element[1]][element[2]] stack = [[N, D, K, []]] complete = [] while stack: node = stack.pop() if _get_pattern_by_stack(node) == 0: continue if not any(node[:3]): complete.append(node[3]) continue if _get_pattern_by_stack([node[0]-1, node[1], node[2]]) != 0: new_node = deepcopy(node) new_node[0] -= 1 stack.append(new_node) if node[0] > node[1]: continue if _get_pattern_by_stack([node[0]-1, node[1] - node[0], node[2]-1]) != 0: new_node = deepcopy(node) new_node[3].append(node[0]) new_node[0] -= 1 new_node[1] -= node[0] new_node[2] -= 1 stack.append(new_node) if not complete: print(-1) return for elm in complete: elm.reverse() complete.sort() print(*complete[0]) if __name__ == "__main__": main()