Stepping Stones!!

5

1 votes
Very-Easy
Problem

In a fantasy land there exists an infinitely long river and a stone bridge to cross the same! Pooja dreams of crossing the river to prove her might! However the task is not as easy as it seems to be! Some of the stones in the bridge are stable while many others are shaky! The bridge of stones follows this pattern: SSUSUUSUUUSUUUU...... Where S stands for Stable and U for unstable. Help Pooja by finding if the kth stone is stable or unstable for given value of k.
Input:
The first line contains only one integer N. N lines follow,the i-th of which contains an integer Ki denoting the number of position in the sequence.
Output:
You are to output N alphabets : 'S' for stable,'U' for unstable separated with a space. More precisely, the i-th alphabet of output is to be equal to the Ki-th digit of described above sequence.
Constraints:
1 ≤ N ≤ 65535
1 ≤ Ki ≤ 231 − 1

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

The sequence would be of the form: SSUSUUSUUUSUUUU and so on. The rocks at 3rd,14th and 6th positions are unstable while the rock at 7th position is stable.Hence the answer U U S U.

Editor Image

?