Nuclear mass number dependence of inclusive pion production by pions and protons at 4.3GeV/c