In Mrs. Everett's class, 3 basic yearbooks and 30 deluxe yearbooks were ordered, totaling $3,171. In Mr. Ayala's class, 3 basic yearbooks and 19 deluxe yearbooks were ordered, totaling $2,082. Determine the cost of the basic yearbook and the deluxe yearbook.