matrix A & B written to output file