See 1.401-10(b)(2) below. You will only use company X's net self employment income unless companies Y & Z have adopted the plan.
§ 1.401-10 Definitions relating to plans covering self-employed individuals.
(b) Treatment of a self-employed individual as an employee.
(1) For purposes of section 401, a self-employed individual who receives earned income from an employer during a taxable year of such employer beginning after December 31, 1962, shall be considered an employee of such employer for such taxable year. Moreover, such an individual will be considered an employee for a taxable year if he would otherwise be treated as an employee but for the fact that the employer did not have net profits for that taxable year. Accordingly, the employer may cover such an individual under a qualified plan during years of the plan beginning with or within a taxable year of the employer beginning after December 31, 1962.
(2) If a self-employed individual is engaged in more than one trade or business, each such trade or business shall be considered a separate employer for purposes of applying the provisions of sections 401 through 404 to such individual. Thus, if a qualified plan is established for one trade or business but not the others, the individual will be considered an employee only if he received earned income with respect to such trade or business and only the amount of such earned income derived from that trade or business shall be taken into account for purposes of the qualified plan.