Synthesis of properly substituted pyridine and pyrimidine derivatives and their biological evaluation as potential antiviral agents