#K61737. Aligned Texts

    ID: 31376 Type: Default 1000ms 256MiB

Aligned Texts

Aligned Texts

Given two texts, determine if the texts are aligned. Two texts are considered aligned if they contain the same set of words with exactly the same frequency regardless of order and letter case. In other words, if each text is represented as a multiset of words (with all letters converted to lower case), the texts are aligned if the multisets are equal. Formally, let ( W_1 ) and ( W_2 ) be the multisets of words for the two texts. The texts are aligned if ( W_1 = W_2 ).

inputFormat

The input consists of two lines read from standard input. The first line contains the first text, and the second line contains the second text. Words in each text are separated by spaces.

outputFormat

Output a single line to standard output containing either 'True' if the two texts are aligned or 'False' otherwise.## sample

Hello world
WORLD HELLO
True