If the number of eight dollar child tickets is 17 less than three times the number of $12 adult tickets and the theater took in $584 how many of each tickets were sold