I am getting the right outputs, but it fails me in every task. Output is:
grandfather
grandmother