import random
class C(chardataeffect.CharDataEffect):
r = ""
a = 1
c = text[i]
# bias the randomness towards inversion of the previous case:
if a > 0:
else:
if a > 0 and c.isalpha():
r = r + c.upper()
elif a < 0 and c.isalpha():
r = r + c.lower()
else:
r = r + c
return r
c = C()
c.affect()