Which martial art or arts did Brazilian jiu-jitsu derive from?

Brazilian jiu-jitsu was initially developed in 1925 by Brazilian brothers Carlos, Oswaldo, Gastão Jr., George, and Hélio Gracie, after Carlos was taught jiu-jitsu by a travelling Japanese judoka, Mitsuyo Maeda, who himself mastered his ground fighting while interacting with Taro Miyake (Tanabe student), Sadakazu Uyenishi (Handa, Tanabe) and Yukio Tani (Tenjin Shinyo-ryu) and catch wrestlers in Europe. Later on, the Gracie family developed their own self-defense system, and published Gracie Jiu-Jitsu.

Brazilian jiu-jitsu was derived from judo and catch wrestling.