Principal Typing in Elementary Affine Logic