Help me in solving DSSA63 problem

My issue

If Man’s name is ‘john’ and Woman’s name is ‘nhoj’, then they are allowed to marry

Learning course: Kalasalingam Academy of Research and Education
Problem Link: CodeChef: Practical coding for everyone