A drunk person was moving from one point on the street to another point on the same street. His starting point was between two manholes on that street. He was following a systematic scheme of his movement and had a fix movement repeated after an interval of time. How much time will he take to fall in the manhole and in which manhole will he fall in.
input
The first line should contain number of test cases 'N' Next 'N' lines should have space separated inputs 'B' or 'F' which will depict the first movement of the drunk person in backward or forward direction respectively next five space separated numbers depict the distance of the hole in forward direction in meters distance of the hole in backward direction in meters forward steps in meters backward step in meters and time taken to complete 1 meter respectively
output
In a single line print the manhole in which he will fall ‘F’ for the manhole that is in forward direction and ‘B’ for the manhole in backward direction followed by the time that he took to fall in that manhole and if he will not fall in any of the manhole then print 'SURVIVED'.