Appending two inputs to a list in a for loop

This is what i have so far

N = int(input())
S = int(input())
listA = []

for i in range(S):
    a=input().strip("#")
    x=a.replace("-"," ")
    listA.append(i)
    
print(listA)
listA = list(map(str, x.split()))
P, S, PD, PP, SS, PDPD = [listA [i] for i in (0,1,2,3,4,5)]
print (P,S,PD,PP,SS,PDPD)

I want to add two inputs such as #34-5-6 and #2-3-4 into the list so it would read 34 5 6 2 3 4 so that then i can assign each number to the variables as listed
N = 1 and S = 2

One way is to strip #, split on - and convert to int (if necessary) using list comprehension:

>>> inputs = '#34-5-6', '#2-3-4',
>>> [int(digit) for record in inputs for digit in record.strip('#').split('-')]
[34, 5, 6, 2, 3, 4]