void write(const array_2d <T>& a, std::ostream& s) { write(a[0], s, a.length()); }
void read(array_2d <T>& a, std::istream& s) { read(a[0], s, a.length()); }