once Petya Vasya invent new game call Smart boy they locate certain set word dictionary game it admissible dictionary contain similar word the rule game follow player choose letter word long 1 word dictionary write piece paper the second player add letter one initial final position make word long 2 player turn add letter begin end make word long 3 but player must not break condition newly create word substre word dictionary the player can not add letter current word break condition losesalso end turn certain string s write paper player turn get number point accord formulawhere sequence number symbol c latin alphabet number start 1 for example number word dictionary line s occur substre your task learn win game final score every player play optimally try win maximize number point minimize number point opponent