((input) => {
  let N = Number(input.trim());
  let sum = 0;

  for (let i = 1; i <= N-1; i++) {
    sum += i;
  }

  console.log((Math.pow(10, N-2) * sum * 2)%1000000007);
})(require("fs").readFileSync("/dev/stdin", "utf8"));