exec"a,b=raw_input().split('==');print sorted(a)==sorted(b)and'same'or'different';"*9