A study of three-nucleon interaction in three- and four-body nuclei