Zones

A diamond-shaped zone grows by extending one of four sides each step; output how many zones border each zone.

Medium7ImplementationGeometrySimulationNo attempts yetTime limit1sMemory limit128 MB

Problem

To improve public transport in the capital, the transport company decided to change the boundaries of its fare zones. The old circular model is replaced by a rhombus model. The city is divided into NN zones numbered 11 to NN.

Zone 11 is a square with side length 11 km, centered at the very center of the city. The square is rotated by 45 degrees, so its four vertices point north, east, south, and west. Zone 22 is obtained by expanding the square of zone 11 in one of the directions north, east, west, or south so that its side length becomes 22 km. Each following zone is obtained by expanding the square again in one of these four directions, and each expansion makes the side 11 km longer. When the square is expanded in a direction, the new square contains the previous one and shares with it the vertex opposite the chosen direction. Zone ii (i2i \ge 2) is the region of the ii-th square that lies outside the (i1)(i-1)-th square.

The figure below shows one possible division of the city into 4 zones: zone 22 expands north, zone 33 expands west, and zone 44 expands north again.

The ticket price in each zone equals the number of zones that share a border with it. In the example above, the ticket price is 2 kuna in zone 11, 3 kuna in zone 22, 3 kuna in zone 33, and 2 kuna in zone 44.

Find the ticket price in every zone.

Input

The first line contains NN (2N3000002 \le N \le 300\,000), the number of zones.

Each of the next N1N-1 lines contains one of the letters S, I, Z, J. The letter on input line ii (2iN2 \le i \le N) is the expansion direction chosen for zone ii: S is north, I is east, Z is west, and J is south.

Output

Print NN lines. On the ii-th line, print the ticket price in zone ii.