A dog has been trained to do a trick.