A plumber bought some pieces of copper and plastic pipe. Each piece of copper pipe was 7 meters long and each piece of plastic pipe was 1 meter long. He bought 9 pieces of pipe. The total length of the pipe was 39 meters. How many pieces of each type of pipe did the plumber buy?