Leet is a way of writing in which each letter of the alphabet is replaced by one or more other characters, used mostly online. For example, replacing A with 4, E with 3, and T with 7 turns the word "ATE" into "437". A single letter may also be replaced by a string longer than one character, such as writing M as |V|.
A letter can sometimes be written in leet in more than one way (for example, D could be [), |), or |>), which is what makes leet hard to read.
Given an original word written in lowercase letters and a word written in leet, write a program that decides whether the two words correspond to each other under all of the following rules.
[), then D cannot also be |> in the same check.|>.The first line contains the number of test cases T. Each test case consists of three lines.
@ \ / - = ^ | [ ] ( ) { } < >.For each test case, print 1 if the original word can be turned into the leet word under the rules, and 0 otherwise, each on its own line.