Computer engineering

A device must retain its program when power is removed and use temporary variables while it runs. Which memory pairing best fits these two roles?