System.in.eachLine{(a,b)=(it=~/[^=]+/)*.split(',')*.sort();println a==b?'same':'different'}