printing both in console