#arc135a. [arc135_a]Floor, Ceil - Decomposition

[arc135_a]Floor, Ceil - Decomposition

Problem Statement

There is an integer XX written on a blackboard. You can do the operation below any number of times (possibly zero).

  • Choose an integer xx written on the blackboard.
  • Erase one xx from the blackboard and write two new integers lfloorfracx2rfloor\\lfloor \\frac{x}{2}\\rfloor and lceilfracx2rceil\\lceil \\frac{x}{2}\\rceil.

Find the maximum possible product of the integers on the blackboard after your operations, modulo 998244353998244353.

What are lfloorfracx2rfloor\\lfloor \\frac{x}{2}\\rfloor and lceilfracx2rceil\\lceil \\frac{x}{2}\\rceil?

For a real number xx, lfloorxrfloor\\lfloor x\\rfloor denotes the largest integer not greater than xx, and lceilxrceil\\lceil x\\rceil denotes the smallest integer not less than xx. For example, the following holds.

  • For x=2x = 2, we have lfloorfracx2rfloor=1\\lfloor \\frac{x}{2}\\rfloor = 1 and lceilfracx2rceil=1\\lceil \\frac{x}{2}\\rceil = 1.
  • For x=3x = 3, we have lfloorfracx2rfloor=1\\lfloor \\frac{x}{2}\\rfloor = 1, lceilfracx2rceil=2\\lceil \\frac{x}{2}\\rceil = 2.

Constraints

  • 1leqXleq10181\\leq X \\leq 10^{18}

Input

Input is given from Standard Input from the following format:

XX

Output

Print the maximum possible product of the integers on the blackboard after your operations, modulo 998244353998244353.


Sample Input 1

15

Sample Output 1

192

Here is a sequence of operations that makes the product of the integers on the blackboard 192192.

  • The initial state of the blackboard is (15)(15).
  • An operation with x=15x = 15 changes it to (7,8)(7, 8).
  • An operation with x=7x = 7 changes it to (8,3,4)(8, 3, 4).
  • An operation with x=4x = 4 changes it to (8,3,2,2)(8, 3, 2, 2).
  • An operation with x=8x = 8 changes it to (3,2,2,4,4)(3, 2, 2, 4, 4).

Here, the product of the integers on the blackboard is 3times2times2times4times4=1923\\times 2\\times 2\\times 4\\times 4 = 192.


Sample Input 2

3

Sample Output 2

3

Doing zero operations makes the product of the integers on the blackboard 33.


Sample Input 3

100

Sample Output 3

824552442

The maximum possible product of the integers on the blackboard after your operations is 58564588684700165856458868470016, which should be printed modulo 998244353998244353.