#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e6 + 5;
const int inf = (int)1e9 * 2;
const int mod = (int)1e9 + 7;
long long n, m, sum1, sum2, ans, cur, temp, cnt = 0, l, r;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  vector<int> left_side;
  vector<int> right_side;
  for (int i = n; i >= 1; i--) {
    if (l <= r) {
      left_side.push_back(i);
      sum1 += i;
      l += i;
    } else {
      right_side.push_back(i);
      sum2 += i;
      r += i;
    }
  }
  cout << abs(sum1 - sum2) << endl;
  cout << left_side.size() << " ";
  for (int i = 0; i < left_side.size(); i++) {
    cout << left_side[i] << " ";
  }
  return 0;
}
