Input is always 4 character?

is this code should only be for 4 characters only or it may have many characters but will always be even

@pulkitgupta622 It can be more than 4 characters and can also be odd. Solve the question keeping this in mind.