Add medium number encoding