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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: C = None
        self.y: B = None
        self.z: A = None
        self.txt = txt

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

e = A("e")
a = B("a")
h = C("h")
l = D("l")
i = A("i")
d = C("d")

e.w = h
e.o = a
e.p = i
a.o = e
a.u = l
a.z = d
a.w = d
h.p = l
h.v = d
h.y = a
h.z = i
l.w = a
l.q = e
l.t = d
i.w = h
i.o = a
i.p = e
d.p = l
d.v = h
d.y = a
d.z = e
assert h.y.z.p.w.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: B = None
        self.p: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: C = None
        self.y: B = None
        self.z: A = None
        self.txt = txt

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

e = A("e")
a = B("a")
h = C("h")
l = D("l")
i = A("i")
d = C("d")

e.w = h
e.o = a
e.p = i
a.o = e
a.u = l
a.z = d
a.w = d
h.p = l
h.v = d
h.y = a
h.z = i
l.w = a
l.q = e
l.t = d
i.w = h
i.o = a
i.p = e
d.p = l
d.v = h
d.y = a
d.z = e
assert h.y.z.p.w.o.o.txt == "a"