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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: B = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.txt = txt

e = A("e")
h = B("h")
i = C("i")
c = A("c")
a = C("a")
b = B("b")

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: B = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.txt = txt

e = A("e")
h = B("h")
i = C("i")
c = A("c")
a = C("a")
b = B("b")

e.p = h
e.z = h
e.o = c
h.w = a
h.v = a
h.t = b
i.s = a
i.v = a
c.p = h
c.z = h
c.o = e
a.s = i
a.v = i
b.w = i
b.t = h
b.v = a
assert c.o.o.p.txt == "h"