#include <bits/stdc++.h>
using namespace std;
const int MAX = 3e5;
int main() {
  int k;
  cin >> k;
  if (k == 0) {
    cout << "1 1\n1";
    return 0;
  }
  int t = 0, tmp = 0, bit = 0;
  while (t + (1 << bit) <= MAX) {
    t += 1 << bit;
    bit++;
  }
  tmp = t;
  t ^= k;
  cout << "3 3\n";
  cout << tmp << " " << k << " 0\n";
  cout << t << " " << tmp << " 0\n";
  cout << "0 " << k << " " << tmp;
  return 0;
}
