How to display actor name on click

Experts,

 I am new to the UE. Need some help with an action that I am trying to do. I have created three cubes (blue print actors) in a level. I named each of these cubes with a unique name. What I want to achieve is whenever I click a specific actor, I want to display its name above that. Need help with the blueprint scripting for this. Also, if someone can provide a sample C++ code for this, would really appreciate it.