#include <bits/stdc++.h>
using namespace std;
int maxn = (1 << 18) - 1;
int main() {
  int k;
  scanf("%d", &k);
  int b = maxn, cnt = 0;
  for (int i = 0; i <= 20; ++i) {
    if ((k >> i) & 1) {
      b ^= (1 << i);
    }
  }
  int cc = maxn >> 1;
  printf("%d %d\n", 3, 3);
  printf("%d %d %d\n", maxn, maxn, b);
  printf("%d %d% d\n", maxn, cc, maxn);
  printf("%d %d %d\n", b, maxn, cc);
  return 0;
}
