d=0 s="" for c in raw_input():s+=[`d`,c][".">c];d-="0)".find(c) print s