there program language program nonempty sequence sign digit Lets explain interpreter programming language work a program interpret movement instruction pointer IP consist part current character pointer CP Direction pointer dp point leave right Initially CP point leftmost character sequence dp point rightwe repeat follow step moment CP point outside sequence if CP point digit interpreter print digit CP move step accord direction dp after value print digit sequence decrease if print digit 0 decrease erase sequence length sequence decrease if CP point direction dp change leave right correspondingly then CP move step accord DP if new character CP point previous character erase sequence if moment CP go outside sequence execution terminatedits obvious program language terminate stepsWe sequence s1s2sn digit you answer q query each query give l r ask digit print run sequence slsl1sr independent program language