def reverse_compliment(sequence):
    """
    Given a sequence consists of A, T, C and G, find reverse compliment of the sequence.
    """

    reference = {'A': 'T', 'C': 'G', 'T': 'A', 'G': 'C', 'N': 'N'}
    reversecompliment = ''.join(reference[x] for x in sequence[::-1])
    return reversecompliment