#K78972. Are Isomorphic Strings

    ID: 35205 Type: Default 1000ms 256MiB

Are Isomorphic Strings

Are Isomorphic Strings

Two strings \(s_1\) and \(s_2\) are said to be isomorphic if there exists a one-to-one mapping between every character of \(s_1\) and every character of \(s_2\), preserving the order. More formally, there is a bijection \(f: \Sigma \to \Sigma\) such that for every index \(i\), \(f(s_1[i]) = s_2[i]\). This problem requires you to determine whether two given strings are isomorphic. For example:

  • egg and add are isomorphic.
  • foo and bar are not isomorphic.

You need to read the input from standard input and print the result to standard output.

inputFormat

The input consists of two lines:

  1. The first line contains the string \(s_1\).
  2. The second line contains the string \(s_2\).

Both strings will be non-empty and contain only printable characters.

outputFormat

Output a single line containing either True if the two strings are isomorphic, or False otherwise.

## sample
egg
add
True