read n for((;n>1;n-=n&1?++i,1:n/2)){ abc ${_:i%3:1} s+=$_ t=$_$t } echo $s\a$t