Input (grade 3): He was a Teachta DÃ la (TD) from 1938 until 1973.
Output (grade 7): He was the fourth President of Ireland from 1973 until his death in 1974, and a TD from 1938 until 1973.