Influx and sources of medium- and high-Z intrinsic impurities in the alcator C tokamak