def parse_s_file(f_name):
    """
    Parses s-file and returns dictionary with 'magnitude' and 'stations' list.
    """
    lines = []
    with open(f_name, 'r') as f:
        lines = f.readlines()

    if not len(lines):
        return

    # Magnitude parse
    magnitude = float(lines[0][55:59])
    magnitude_type = lines[0][59]

    if magnitude_type != 'L':
        print(f'In file "{f_name}": unsupported magnitude type "{magnitude_type}"! Skipping..')
        return

    # Stations parse
    th = ' STAT SP IPHASW D HRMM SECON CODA AMPLIT PERI AZIMU VELO AIN AR TRES W  DIS CAZ7'
    stations = []

    is_table = False
    for l in lines[1:]:

        if is_table:
            s = l[1:6].strip()

            if len(s) and s not in stations:
                stations.append(s)

        if not is_table and l[:len(th)] == th:
            is_table = True

    return {'magnitude': magnitude, 'stations': stations}