class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.txt = txt

c = A("c")
h = B("h")
i = A("i")
l = B("l")
a = A("a")

c.z = h
c.o = h
h.p = l
h.s = l
i.z = h
i.o = h
l.p = h
l.s = h
a.z = h
a.o = h
assert c.z.s.s.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.txt = txt

c = A("c")
h = B("h")
i = A("i")
l = B("l")
a = A("a")

c.z = h
c.o = h
h.p = l
h.s = l
i.z = h
i.o = h
l.p = h
l.s = h
a.z = h
a.o = h
assert c.z.s.s.p.p.txt == "h"