(x=$_[/(.)\1* /] y=$_[/ (.)\1*/] puts x.size>y.size ? x[0] : y[-1])while gets