B2. In the first semester, there were twice as many boys as girls in class $B$, and the number of boys was equal to the number of girls in class $A$. In the second semester, two boys transferred from class $B$ to class $A$, and 6 girls transferred from class $A$ to class $B$. At that time, there were twice as many boys as girls in class $A$, and in class $B$ there was one more boy than girls. How many girls were there in the first semester in class $A$ and how many in class $B$?
B2. Let $\mathrm{z} x$ be the number of boys or girls $\mathrm{v}$ in class $A$, and $\mathrm{z} y$ be the number of girls $\mathrm{v}$ in class $B$ in the 1st semester. Let's write the number of boys and girls in the first and second semesters in a table.

|  | class $A$ |  | class $B$ |  |
| :---: | :---: | :---: | :---: | :---: |
| 1st semester | boys | girls | boys | girls |
|  | $x$ | $x$ | $2 y$ | $y$ |
| 2nd semester | boys | girls | boys | girls |
|  | $x+2$ | $x-6$ | $2 y-2$ | $y+6$ |

Since in the second semester, in class $A$ there were twice as many boys as girls, the relationship $x+2=2(x-6)$ holds. Therefore, $x=14$. In class $B$, in the second semester, there was 1 more boy than there were girls, so $2 y-2=(y+6)+1$. Therefore, $y=9$. In the first semester, there were 14 girls in class $A$, and 9 in class $B$.

Write the table for class $A$ and $B$ in the 1st semester ...........................................................................................................

![](https://cdn.mathpix.com/cropped/2024_06_07_7876a7df18fe8c6add15g-5.jpg?height=62&width=1690&top_left_y=2162&top_left_x=223)

![](https://cdn.mathpix.com/cropped/2024_06_07_7876a7df18fe8c6add15g-5.jpg?height=63&width=1694&top_left_y=2227&top_left_x=221)

![](https://cdn.mathpix.com/cropped/2024_06_07_7876a7df18fe8c6add15g-5.jpg?height=63&width=1694&top_left_y=2290&top_left_x=221)

![](https://cdn.mathpix.com/cropped/2024_06_07_7876a7df18fe8c6add15g-5.jpg?height=66&width=1694&top_left_y=2360&top_left_x=221)

![](https://cdn.mathpix.com/cropped/2024_06_07_7876a7df18fe8c6add15g-5.jpg?height=71&width=1694&top_left_y=2423&top_left_x=221)

Answer: In the first semester, there were 14 girls in class $A$, and 9 in class $B$. ....... 1 point