Jim purchased 2 pieces of property that had been foreclosed on by a local bank for a total of $330,000. When he sold these properties, on the first piece Jim earned a profit of 12% but on the second piece he lost 8%. His total profit was $18,000. How much did Jim pay for each property?