Fraction of work complete by (A and B) + Fraction of work complete by (B and C) + Fraction of work completed by C = 1
As B did the work for 8 days we can say B did the work for 3 days with A and B did the work for 5 days with C. So, A and B together did the work for 3 days, B and C together did the work for 5 days, C alone did the work for 5 days.
∴ 3/12 + 5/15 + 5/x = 1 or 5/x = 5/12
i.e., x = 12 or C alone can complete the work in 12 days