implement T from input read