#include <bits/stdc++.h>
using namespace std;

vector<vector<int>> generate(int pos, int N, int mn_sum, vector<pair<int, int>> &a) {
    if (N < mn_sum || pos >= a.size()) return {};
    vector<vector<int>> ret;
    pair<int, int> p = a[pos];
    if (pos == a.size() - 1 && N <= p.second) {
        ret.push_back({N});
        return ret;
    }
    int mn = p.first, mx = p.second;
    for (int i = mn; i <= mx; i++) {
        auto cur = generate(pos + 1, N - i, mn_sum - mn, a);
        for (auto c: cur) {
            c.insert(c.begin(), i);
            ret.push_back(c);
        }
    }
    return ret;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N; // input given by user
    cin >> N;
    vector<pair<int, int>> a = {{25, 30}, {25, 30}, {17, 20}, {5, 10}, {8, 10}};
    int mn_sum = 0;
    for (auto p: a) mn_sum += p.first;

	//generate all possible solutions
    auto res = generate(0, N, mn_sum, a);
    
    if (res.size() == 0) {
        cout << "No answer possible for the given N" << "\n";
    } else {
        //randomly pick one answer between 0 and res.size()
        //you can replace this with any desired probability distribution methods
        srand(time(NULL)); // Seed the time
        int rand_num = rand() % (res.size());
        for (int v: res[rand_num]) 
            cout << v << " ";
        cout << "\n";
    }

    return 0;
}