Which endocrine gland produces melatonin?

Pituitary gland

Thymus

Adrenal cortex

Pineal gland