get the K - th letter
for ( int i = N - 1 ; i >= 0 ; -- i ) { K %= size ; if ( K == 0 && isalpha ( S [ i ] ) ) return ( string ) " " + S [ i ] ; if ( isdigit ( S [ i ] ) ) size = size / ( S [ i ] - '0' ) ; else size -= 1 ; } }