fork download
  1. s = '1'*47+'2'*48
  2. print(s)
  3.  
  4. while ('111' in s) or ('222' in s):
  5. if '111' in s:
  6. s = s.replace('111', '22', 1)
  7. else:
  8. s = s.replace('222', '12', 1)
  9.  
  10. print(s)
Success #stdin #stdout 0.05s 63088KB
stdin
Standard input is empty
stdout
11111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222
1122