<s>[INST] A group of 7 friends, including John and Emily, go to a restaurant for dinner. They select seats at a rectangular table that seats 8 people. One side of the table has 4 seats, and the adjacent side has 4 seats as well. The remaining two seats are at the ends of the table. If all 7 friends sit at the 7 available seats, and John sits at one of the ends, in how many different ways can the friends arrange themselves at the table?[/INST]