def print_link_stats(link_pattern):
    resolved_reversed = {}
    resolved = []
    unresolved_local = []
    unresolved_remote = []

    for local_id, links in link_pattern.items():
        if len(links['items']):
            resolved.append(local_id)
            resolved_reversed[links['items'][0]] = local_id
        else:
            unresolved_local.append(local_id)

    for track in user_tracks:
        track_id = track['track']['id']
        if track_id not in resolved_reversed:
            unresolved_remote.append(track_id)

    print(f"Local Tracks: {len(local_library)}")
    print(f"Remote Tracks: {len(user_tracks)}")

    unresolved_remote = sort_remote_tracks_by_popularity(unresolved_remote)
    unresolved_remote = unresolved_remote[0:min(len(unresolved_remote), 100)]

    print(f"\nUnresolved tracks from the remote: {len(unresolved_remote)}")
    index = 0
    for remote_id in unresolved_remote:
        remote_track = user_tracks_by_id[remote_id]
        print(f"   {index}: '{remote_track['name']}' by '{get_artists_str(remote_track['artists'])}'")
        index += 1

    print(f"\nResolved tracks: {len(resolved)}")
    index = 0
    for link in resolved:
        remote_id = link_pattern[link]['items'][0]
        local_track = local_library[link]
        remote_track = user_tracks_by_id[remote_id]

        print(f"    {index}: '{local_track['name']}' by '{local_track['artist']}'", end='  ----> ')
        print(f"'{remote_track['name']}' by '{get_artists_str(remote_track['artists'])}'")
        index += 1