fork download
  1. T = list(input())
  2. T_ = []
  3.  
  4.  
  5. for i in range(len(T)):
  6. if T[i].isupper() is True :
  7. T_.append(T[i])
  8. else :
  9. continue
  10.  
  11. if T_.count('U') >= 1 and T_.count('C') >= 2 and T_.count('P') >= 1:
  12. for j in range(len(T_)):
  13. if T_[j] == 'U' :
  14. if T_[j] == 'C' :
  15. if T_[j] =='P' :
  16. if T_[j] == 'C':
  17. break
  18. print('I love UCPC')
  19.  
  20. else :
  21. print('I hate UCPC')
  22.  
Success #stdin #stdout 0.02s 9216KB
stdin
UPCC
stdout
I love UCPC