import sys

print("Checking for dead containers...")

l = [i for i in sys.stdin.read().split("\n") if i]
header, statuses = l[0], l[1:]

status_index = header.find('STATUS')
name_index = header.find('NAMES')

exit_code = 0

for i in statuses:
    if not i[status_index:].startswith("Up "):
        service_name = i[name_index:]
        print(f"Crash detected in {service_name}")
        exit_code = 1

sys.exit(exit_code)
