class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.q: C = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: E = None
        self.q: A = None
        self.z: A = None
        self.u: A = None
        self.txt = txt

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

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

d = A("d")
g = B("g")
l = C("l")
i = D("i")
e = E("e")
f = E("f")

d.y = e
d.r = l
d.q = l
d.v = g
g.r = e
g.w = f
g.z = i
l.w = d
l.q = d
l.z = d
l.u = d
l.t = f
i.r = f
i.s = l
i.v = l
e.v = g
e.u = g
e.o = d
f.v = g
f.u = g
f.o = d
assert l.t.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.q: C = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: E = None
        self.q: A = None
        self.z: A = None
        self.u: A = None
        self.txt = txt

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

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

d = A("d")
g = B("g")
l = C("l")
i = D("i")
e = E("e")
f = E("f")

d.y = e
d.r = l
d.q = l
d.v = g
g.r = e
g.w = f
g.z = i
l.w = d
l.q = d
l.z = d
l.u = d
l.t = f
i.r = f
i.s = l
i.v = l
e.v = g
e.u = g
e.o = d
f.v = g
f.u = g
f.o = d
assert l.t.o.y.txt == "e"