during this hospital encounter what was the first ward id of patient 40059?
select transfers.wardid from transfers where transfers.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 40059 and admissions.dischtime is null ) and transfers.wardid is not null order by transfers.intime asc limit 1