Bill is an excellent programmer (not coder, of course) of one of the best software companies in the world. Recently, he is working on some projects which frequently read and write files. Considering space efficiency and universality, he decides to manipulate these files in binary format.
Here are the format definitions:
|Type||Descriptor||Bytes needed in files|
|32-bit unsigned integer||UINT||4|
|32-bit signed integer||INT||4|
|16-bit unsigned integer||USHORT||2|
|16-bit signed integer||SHORT||2|
|8-bit byte (unsigned)||BYTE||1|
|String||STR||2 + length of the string|
One more thing about item is that strings are stored in files as the format [L][S]. L is the length of string, it's a USHORT item. And S is the string itself, it's a sequence of L characters.
Based on the definitions above, a function named Read is defined as: 'Read(dataType);'. Data read from files is directly output to screen.
Similarly, there's another function: 'Skip(dataType);' which moves the file pointer forward by the bytes of the data type.
Now let's come to the problem, given a file and several invocations of Read function or Skip function with certain parameters, output proper result on the following rules:
Input contains several test cases, each test case is as following:
N is the number of lines in file data. M is the number of operations. 0 < N, M < 100. If N and M are both zero, input ends.
File data is represented by hex numbers, each indicates one byte of file, from the first to the last. Hex numbers are separated by only one space, there're 100 hex numbers in a line at most. Each hex number is always 2-digit long and contains only numbers and uppercase characters (if necessary).
Each operations has the format '<R|S><SP>dataType', R is for Read, S is for Skip, dataType is based on the table above. SP indicates only one space.
For successful reading operation, output the data read, in decimal if data is not a string, one per line. For other operations, don't output anything.
After each test case, please output a blank line.
1 3 01 0A 02 00 00 0C 01 R BYTE S UINT R SHORT 2 1 0B 00 41 42 43 44 45 46 47 48 49 4A 4B R STR 0 0
1 268 ABCDEFGHIJK