|Online MIPT programming contest||РУССКИЙ|
Time limit = 2 second(s)You are given two regular expressions R1 and R2 and should find minimal string S matching both. String consists of capital latin letters A..Z. Regular expression is word consisting of A..Z and * ? symbols. The symbol * corresponds to any word or empty word. The symbol ? corresponds to one letter.
Input Two lines with regular expressions R1 and R2, each line has less than 500 characters.
Output String S one of the strings with minimal length matching both regular expressions. If string matching R1 and R2 does not exist, then output #.
From the book "National features of programming problems" 29 September 2003
© acm.mipt DevGroup
The page was generated in 190ms