#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <set>

using namespace std;

signed main() {
    int x;
    cin >> x;
    string s;
    if (x == 0) s = "0";
    while (x > 0) {
        s += (char)('0' + (x % 2));
        x >>= 1;
    }
    while (s.size() % 7 != 0) s += '0';
    reverse(s.begin(), s.end());
    int b = (s.size()) / 7;
    for (int i = 0; i < b; i++) {
        int val = 0;
        for (int j = 7 * i; j < 7 * i + 7; j++) {
            val = 2 * val + (s[j] - '0');
        }
        if (i != b - 1) val += 128;
        cout << val << " ";
    }
    cout << '\n';
}