# Befunge '98, 31 bytes

    a>:|>1++:9`#@_a,
    v*'[^
    >,v1
    -v>