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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.r: B = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: A = None
        self.s: A = None
        self.txt = txt

e = A("e")
n = B("n")
d = C("d")
a = D("a")
f = C("f")
c = D("c")

e.z = c
e.x = a
e.u = d
n.t = f
n.w = f
n.s = e
n.r = d
d.o = e
d.y = e
d.s = e
d.r = n
a.y = e
a.z = e
a.s = e
f.o = e
f.y = e
f.s = e
f.r = n
c.y = e
c.z = e
c.s = e
assert c.s.u.o.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: D = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.r: B = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: A = None
        self.s: A = None
        self.txt = txt

e = A("e")
n = B("n")
d = C("d")
a = D("a")
f = C("f")
c = D("c")

e.z = c
e.x = a
e.u = d
n.t = f
n.w = f
n.s = e
n.r = d
d.o = e
d.y = e
d.s = e
d.r = n
a.y = e
a.z = e
a.s = e
f.o = e
f.y = e
f.s = e
f.r = n
c.y = e
c.z = e
c.s = e
assert c.s.u.o.z.y.txt == "e"