import std.algorithm, std.array, std.container, std.range, std.bitmanip;
import std.numeric, std.math, std.bigint, std.random, core.bitop;
import std.string, std.regex, std.conv, std.stdio, std.typecons;

void main()
{
  auto x = readln.chomp.to!int;

  if (x > 31) {
    writeln(0, " ", 0);
  } else if (x == 0) {
    writeln(1, " ", 0);
  } else {
    auto a = nCr(31, x);
    auto b = ((1L << 31) - 1) * nCr(30, x - 1);
    writeln(a, " ", b);
  }
}

BigInt nCr(int n, int k)
{
  BigInt r = 1;
  foreach (i; 1..n + 1)
    r *= BigInt(i);
  foreach (i; 1..k + 1)
    r /= BigInt(i);
  foreach (i; 1..(n - k) + 1)
    r /= BigInt(i);
  return r;
}