from itertools import groupby
input = '11112222222333333333333333444555555555555555111111111777777777'
seq = []
result = []
for _,g in groupby(input):
seq = list(g)
if len(seq) > len(result):
result = seq
print(''.join(result))
ZnJvbSBpdGVydG9vbHMgaW1wb3J0IGdyb3VwYnkKCmlucHV0ID0gJzExMTEyMjIyMjIyMzMzMzMzMzMzMzMzMzMzNDQ0NTU1NTU1NTU1NTU1NTU1MTExMTExMTExNzc3Nzc3Nzc3JwoKc2VxID0gW10KcmVzdWx0ID0gW10KCmZvciBfLGcgaW4gZ3JvdXBieShpbnB1dCk6CglzZXEgPSBsaXN0KGcpCglpZiBsZW4oc2VxKSA+IGxlbihyZXN1bHQpOgoJCXJlc3VsdCA9IHNlcQoKcHJpbnQoJycuam9pbihyZXN1bHQpKQ==