Text this: The Smith normal form of product distance matrices