Luisa is playing in a Mario Kart championship, and one of her competitors released a flurry of green shells on her. Green shells are a power up that, when used, will launch a turtle shell in some direction indefinitely and will bounce off walls until it hits some other competitor. Luisa is unsure of the exact mechanics that define the path of a green shell; all she knows is that she wants to avoid them, and the more paths to the finish line there are, the less likely she is to encounter one.
Being a good friend of hers, you have hacked into the map and can now redesign it to her benefit. You know there are $$$n$$$ junctions in the current map Luisa is racing in, and you will redesign the map by first removing all pre-existing roads, then by adding in roads connecting a pair of junctions. These roads can be traversed bidirectionally. You also know that Luisa will always take the least number of roads needed to reach the junction containing the finish line, regardless of the lengths of the roads. To minimize the chances that Luisa encounters a green shell, you want to redesign the map to maximize the number of routes Luisa can take. Before considering the new map design, you first want to answer the following question: what is the maximum number of shortest routes you can achieve with any new map design?
More formally, let the map Luisa is on be represented by a graph. If she is currently in node $$$1$$$ and her target is in node $$$n$$$, determine the maximum number of shortest paths that you can create by placing edges between pairs of nodes. A shortest path from $$$1$$$ to $$$n$$$ is defined as a path with the minimal number of edges that starts in node $$$1$$$ and ends in node $$$n$$$.
The first and only line of input will consist of a single integer $$$n$$$ ($$$2 \leq n \leq 10^9$$$) — the number of junctions in the map.
Output a single integer: the maximum number of shortest paths you can create. Since this value can be large, output the answer under modulo 998244353.
4
2
6
4