On the structure of flat chains modulo p