rebuilt order of input