Carrie likes to knit hats and mittens for friends and family. Last fall, she knitted 3 hats and 3 pairs of mittens, which took a total of 42 hours. This fall, she knitted 1 hat and 3 pairs of mittens, which took a total of 34 hours. If each hat and each pair of mittens takes the same amount of time to knit, how long does it take Carrie to knit a hat and a pair of mittens?