beecrowd | 2593

Eachians I

By Victor Jatobá and Ariane Machado, USP BR Brazil

Timelimit: 4

The Eachians are very concerned about the text that has received from neighboring planet. They suspect that there is a pattern in the number represented by a word position in the text. These positions together, they say, represents a key to deactivate a bomb that is about to explode the EACH planet.

You were then summoned to developing a program that receive a text and a set of words and return the first position of each word that is present in the text.

Constraints:

Input

The input need be, exactly:

Output

For each word, the program must print the position of the first letter present in the text. Mind that the words can be repeated in the text. In this instance, the positions must be printed one in front of other, separated with whitespaces. If the text doesn’t contain the word, return -1 (the number minus one).

Input Samples Output Samples

see a bear sell stock see a bull buy stock bid stock bid stock hear the bell stop

3

bear bid hear

6

43 53

63

lorem ipsum dolor sit amet meis illum nec at summo cetero et usu adhuc justo tacimates cum et sint pericula mei eu pri ipsum eruditi periculis an no usu graecis explicari has animal sententiae in ut oportere suscipiantur mea ex est ullum quaestio in sit eius tibique no dolore numquam qui sed malorum persius utroque te ei sed omittam dissentias quaerendum ipsum altera vocent at cum facilisis iracundia sea ea mel tollit eripuit ex ne mei discere albucius sit tation convenire interesset at est te modus augue ei tempor assueverit eam ius causae definiebas at te wisi vituperata eos quem feugait vulputate mel et eum ut dicat ornatus pro cu prima deleniti patrioque ex mel ridens doctus mel consul volumus noluisse te mel oblique noluisse an te vis errem consulatu theophrastus est ne atomorum intellegam et mei scripta admodum has cu tollit primis essent exerci equidem vix te his ut sonet elaboraret qui at dicam epicurei et vel saepe instructior in soluta percipitur est quo reque voluptatum utfacilis tibique sapientem qui ut quo scripta voluptaria ad mea at possit nusquam mandamus duis facer legimus te sea id sale meis atqui nec scripta antiopam qui te nominavi mnesarchum incorrupte ut his qui ei putant impedit facilis partem nullam elaboraret vix id id probatus omittantur pro eum in ornatus repudiandae id qui alterum honestatis disputando errem graeco audiam vim ne

1

ipsum

6 119 357