fork download
  1. # your code goes here
  2. a=",I,You,He,We,They".split(',')
  3. m="012345014444042242042345044444042545"
  4. r=0
  5. for p in raw_input().split('+'):r=int(m[int(m[a.index(p)])+r*6])
  6. print a[r]
Success #stdin #stdout 0.01s 8976KB
stdin
I+You+He+They
stdout
We