Social networks and social activities promote cognitive functioning in both concurrent and prospective time: evidence from the SHARE survey