fork download
  1. f = lambda s:[''.join(' o'[cmp(*x)==n]for x in zip(s,s[1:]))for n in-1,0,1]
  2.  
  3. for _ in range(6):
  4. s = raw_input()
  5. print s
  6. print '\n'.join(f(s))
  7. print
Success #stdin #stdout 0s 9032KB
stdin
HELLOWORLD
TESTCASE
EXAMINATION
ZSILENTYOUTH
ABC
ABCBA
stdout
HELLOWORLD
 o oo o  
  o      
o    o oo

TESTCASE
 oo  o 
       
o  oo o

EXAMINATION
o o o o o 
          
 o o o o o

ZSILENTYOUTH
  o ooo o  
           
oo o   o oo

ABC
oo
  
  

ABCBA
oo  
    
  oo