#C9708. Isomorphic Strings

    ID: 53831 Type: Default 1000ms 256MiB

Isomorphic Strings

Isomorphic Strings

Given two strings s1 and s2, determine whether they are isomorphic.

Two strings are considered isomorphic if the characters in s1 can be replaced to get s2, and the mapping between characters is one-to-one and onto. In other words, no two characters in s1 may map to the same character in s2, and a character must consistently map to the same character.

For example, "paper" and "title" are isomorphic since the mapping p→t, a→i, e→l, r→e holds, whereas "foo" and "bar" are not isomorphic.

Your task is to write a program which reads two strings from the standard input and prints "Isomorphic" if they satisfy the isomorphism condition, otherwise prints "Not Isomorphic".

inputFormat

The input consists of two lines:

  • The first line contains the string s1.
  • The second line contains the string s2.

outputFormat

Output a single line containing either "Isomorphic" or "Not Isomorphic" based on whether the given strings are isomorphic.

## sample
paper
title
Isomorphic