1. Had he been waiting for three hours? (wait)
2. Your friends had been studying at this university for five years. Was it difficult? (study)
3. Had anybody been smoking? I could smell cigarettes. (smoke)