def Bellman_Ford(G, s):
    dist = {}

    for v in G:
        dist[v] = float('inf')

    dist[s] = 0

    for i in range(len(G) - 1):
        for u, v, w in G["edges"]:
            if dist[u] != float('inf') and dist[v] > dist[u] + w:
                dist[v] = dist[u] + w

    for u, v, w in G["edges"]:
        if dist[u] != float('inf') and dist[v] > dist[u] + w:
            return False

    print("Shortest Distances:")
    for v in dist:
        print(v, ":", dist[v])

    return True


# Example
G = {
    "A": [],
    "B": [],
    "C": [],
    "D": [],
    "edges": [
        ("A", "B", 4),
        ("A", "C", 5),
        ("B", "C", -2),
        ("C", "D", 3)
    ]
}

print("Negative Cycle Present:", not Bellman_Ford(G, "A"))