4. A group of 17 middle school students went to several places for a summer social survey, with a budget for accommodation not exceeding $x$ yuan per person per day. One day, they arrived at a place with two hostels, $A$ and $B$. $A$ has 8 first-class beds and 11 second-class beds; $B$ has 10 first-class beds, 4 second-class beds, and 6 third-class beds. It is known that the daily rates for first-class, second-class, and third-class beds are 14 yuan, 8 yuan, and 5 yuan, respectively. If the entire group stays in one hostel, they can only stay at $B$ according to the budget. Then the integer $x=$ $\qquad$.