PHP, 127 Bytes ============== for($l=ord($r=($s=$argn)[0]);$x=ord($s[++$i]);$l=$x)$r.=str_pad("",($a=abs($n=$l-$x))<14?$a:26-$a,"><"[$n>0^$a>13])."*";echo$r; [Testcases][1] PHP, 137 Bytes -------------- for($l=$r=($s=$argn)[0];$s[++$i];$l=$s[$i])$r.=str_pad("",$d=min($a=abs(ord($l)-ord($s[$i])),$b=26-$a),"><"[$d<$b^$l<$s[$i]])."*";echo$r; [Testcases][2] [1]: http://sandbox.onlinephpfunctions.com/code/8d73e527b11efd1d80f81c760bae80a2fccbddf5 [2]: http://sandbox.onlinephpfunctions.com/code/b58e431502b6c637171aa3a76848a077ffd49c9f