whats the last ward id of patient 81783 during the first hospital encounter?
select transfers.wardid from transfers where transfers.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 81783 and admissions.dischtime is not null order by admissions.admittime asc limit 1 ) and transfers.wardid is not null order by transfers.intime desc limit 1