def pentad_to_month_day(p):
    """
    Given a pentad number, return the month and day of the first day in the pentad
    
    :param p: pentad number from 1 to 73
    :type p: integer
    
    :return: month and day of the first day of the pentad
    :rtype: integer   
    """
    assert 0 < p < 74, 'p outside allowed range 1-73 ' + str(p)
    m = [1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
         3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4,
         5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6,
         7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8,
         9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10,
         11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12]
    d = [1, 6, 11, 16, 21, 26, 31, 5, 10, 15, 20, 25, 2, 7, 12, 17, 22,
         27, 1, 6, 11, 16, 21, 26, 1, 6, 11, 16, 21, 26, 31, 5, 10, 15, 20,
         25, 30, 5, 10, 15, 20, 25, 30, 4, 9, 14, 19, 24, 29, 3, 8, 13, 18,
         23, 28, 3, 8, 13, 18, 23, 28, 2, 7, 12, 17, 22, 27, 2, 7, 12, 17, 22, 27]
    return m[p - 1], d[p - 1]