To solve this problem, we need to check for all the variations(scales) of the given string. There are 12 possible different variations. Mapping techniques can be used to easily generate those variations. Then we need to match the variations with the original string. Different matching algorithms can be used to do this. Trying brute force or an inefficient way will give TLE. The time limit and memory limit constraints for this problem are tight.