#include <bits/stdc++.h>
using namespace std;
void init_code() {}
signed main() {
  init_code();
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  while (T--) {
    long long int n;
    cin >> n;
    vector<long long int> v;
    long long int ans = 0;
    for (long long int i = n; i >= 1; i--) {
      if (ans <= 0) {
        v.push_back(i);
        ans = ans + i;
      } else
        ans = ans - i;
    }
    cout << abs(ans) << "\n";
    cout << v.size() << " ";
    for (long long int i = 0; i < v.size(); i++) {
      cout << v[i] << " ";
    }
    cout << "\n";
  }
}
