Find the rightmost cousin of a binary tree

Given a node in a binary tree. Find the rightmost cousin of the give node.

Let’s start with an example.

                             1
                          /      \
                         2        3
                      /         /   \
                     4         5     6
                       \           /
                        7         8

Rightmost cousin of 4 is 6, right most cousin of 7 is 8 and so on.