You are at a local amusement park, and notice a spinning teacup ride. After observing it for a bit, you notice a few interesting things about the ride.
The ride consists of N circular teacups, all equally spaced around the circumference of a turntable: for i=0,1,…,N−1, the i-th teacup is centered at the point which is initially i⋅N360 degrees clockwise from North. The turntable is large enough to accommodate all of the teacups without them banging into each other. In each teacup, there are N people, all equally spaced around the circumference of the teacup: for i=0,1,…,N−1, the i-th person is located at the point which is initially i⋅N360 degrees clockwise from North. As teacups are large enough, consider people as points. In each teacup, for i=0,1,…,N−1, the i-th person has happiness value v_i. Note that the people at the same initial position in different teacups have the same happiness value.
Over the course of Q milliseconds, one of two events happens every millisecond:
You want to calculate the total happiness of all people, initially and after every event. The total happiness is the sum of individual people's happiness. If a person with happiness value w is on a straight line formed by the centers of two teacups, their happiness is equal to w. Otherwise, their happiness is zero. As the total happiness may be large, please output it modulo 998,244,353.
Please write a program to track the total happiness of the participants!
The first line contains two integers N and Q (2≤N≤200,000, 1≤Q≤200,000).
The next line contains N integers, the values v_0,v_1,…,v_N−1 (1≤v_i≤1,000,000).
The next Q lines describe the events. Each line is formatted as either "1 k_i" (1≤k_i≤N), indicating the turnable rotates k_i⋅N360 degrees clockwise, or "2 q_i k_i" (0≤q_i<N, 1≤k_i≤N) indicating the teacup currently at q_i⋅N360 degrees (from the top) rotates by k_i⋅N360 degrees clockwise about its center.
Output Q+1 lines, each one containing the total happiness after 0,1,2,…,Q events.
Remember to output the happiness modulo 998,244,353.