Student A does exactly 9 minutes of homework nightly. Student B manages to do 11 minutes. As not to exceed these limits, they work together, using sandclocks that measure 5 and 7 minutes respectively. With this help, they manage to time their work exactly. How?