#!/usr/pkg/bin/python3.13

import sys
import time

line = sys.stdin.readline().strip()

if 'shutdown' in line:
    sys.stderr.write('  (ok) api.nothing shutdown %s\n' % line)
    sys.stderr.flush()
    time.sleep(3)
    sys.exit(1)

sys.stderr.write('  (failure) api.noting received data: %s\n' % line)
sys.stderr.flush()
sys.stdout.write('announce route 6.6.6.0/24 next-hop 9.9.9.9\n')
sys.stdout.flush()

try:
    now = time.time()
    while True and time.time() < now + 5:
        line = sys.stdin.readline().strip()
        if not line or 'shutdown' in line:
            break
        time.sleep(1)
except IOError:
    pass
