There are some students in the two examination halls A and B. To make the number of students equal in each hall, 10 students are sent from A to B. But if 20 students are sent from B to A, the number of students in A becomes double the number of students in B. Find the number of students in the two halls.