You have a 128-byte long buffer that is initially filled with zeroes. Given a scanf format string, some offsets in the buffer, and some text, fill the buffer according to the format string and print the final contents of the buffer.

The format string consists of a sequence of directives which describe how to process the sequence of input characters. A directive is one of the following:

  • A sequence of space characters. This directive matches any amount of space characters, including none, in the input.
  • An ordinary character (i.e., one other than white space or '%'). This character must exactly match the next character of input.
  • A conversion specification, which commences with a '%' (percent) character. A sequence of characters from the input is converted according to this specification, and the result is placed in the corresponding position in the buffer (the result of the ith conversion should be stored in the buffer starting at the ith offset).
There are four conversion specifiers:
Matches an unsigned 4 byte long integer. It is stored in the buffer in little-endian order (least significant byte first).
For example, 1241251 (which is 12F0A316) is stored as A3 F0 12 00.
Matches 0x followed by an unsigned 4 byte long hexadecimal integer. It is stored in the buffer in little-endian order.
For example, 0xFEE1DEAD is stored as AD DE E1 FE.
Matches a sequence of non-white-space characters.
For example, hello is stored as 68 65 6C 6C 6F 00
Matches a single character
For example, x is stored as 78


On the first line, a format string and several integer offsets. The format string and offsets are separated by commas. There is no space before or after a comma.
On the second line, the text you should scan.


Exactly 256 uppercase hex digits (0-9A-F) representing the contents of the buffer. You may append a final newline.


  • The format string is at most 150 characters long.
  • Each position in the buffer will be set at most once. In other words, the memory areas do not overlap.
  • For the %s specifier it is guaranteed that the next character will NOT be a space character.


Alina are %u %s cu ID:%x,10,100,4
Alina are 3 mere cu ID:0xABCDEF
Things we have here: %c%c%c %s (less than %u units).,0,2,4,5,50
Things we have here: ^_^ word!with!bangs!!! (less than 40000 units).

Sponsors Gold