In this task, you are given an input list A. You need to extract and sort the unique digits used in the list in ascending order. Return -1 if there is no digit in the list.

['m', 'e', 'g']
-1

['p', 't', '211', 'r', '439', 'h', 'g', 'c', '299', '371']
1, 2, 3, 4, 7, 9

['p', 'p', '387', '411', '393', '99', 'h', 'i', '171', '117', '413', 'n']

1, 3, 4, 7, 8, 9