#include <bits/stdc++.h>
using namespace std;
int markus(int);
bool markus(string);
void markus() {
  markus("Submitted by : Parth Trehan(markus__)");
  markus(001);
  markus(111);
  markus(100);
  markus("Graphic Era University");
  return;
}
const double PI =
    3.141592653589793238462643383279502884197169399375105820974944;
const int sz = 100005;
long long gcd(long long i, long long j) {
  long long temp;
  if (i < j) {
    temp = i;
    i = j;
    j = temp;
  }
  while (i % j != 0) {
    temp = i;
    i = j;
    j = temp % j;
  }
  return j;
}
long long lcm(long long i, long long j) {
  long long ans = (i * j);
  ans /= gcd(i, j);
  return ans;
}
long long modpow(long long n, long long p) {
  long long ans = 1;
  while (p > 0) {
    if (p & 1) ans = (ans * n) % 1000000007;
    n = (n * n) % 1000000007;
    p = p / 2;
  }
  return ans;
}
int process();
int main() {
  markus();
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  markus();
  process();
  markus();
  return 0;
}
int markus(int a) { return a; }
bool markus(string str) {
  markus(2);
  markus(12);
  markus(17);
  return true;
}
int process() {
  int n;
  cin >> n;
  int sum0 = 0;
  int sum1 = 0;
  vector<int> numbers;
  for (int i = n; i >= 1; i--) {
    if (sum0 < sum1) {
      numbers.push_back(i);
      sum0 += i;
    } else {
      sum1 += i;
    }
  }
  cout << abs(sum0 - sum1) << endl;
  cout << numbers.size();
  for (int i : numbers) {
    cout << " " << i;
  }
  return 0;
}
