/**
 *    author:  tourist
 *    created: 05.11.2025 18:26:30
**/
#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  if (n == 0) {
    cout << 0 << '\n';
    return 0;
  }
  vector<int> a;
  while (n > 0) {
    a.push_back(n % 128);
    n /= 128;
  }
  for (int i = int(a.size()) - 1; i >= 0; i--) {
    cout << a[i] + (i > 0 ? 128 : 0) << " \n"[i == 0];
  }
  return 0;
}
