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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: A = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: A = None
        self.x: B = None
        self.y: A = None
        self.txt = txt

m = A("m")
g = B("g")
e = C("e")
j = D("j")
b = E("b")
a = D("a")
d = D("d")
f = B("f")

m.w = a
m.u = e
m.v = f
m.y = d
g.z = b
g.v = e
g.o = f
e.t = b
e.r = m
e.z = a
j.p = e
j.t = m
b.w = m
b.q = m
b.y = m
b.x = g
a.p = e
a.t = m
d.p = e
d.t = m
f.z = b
f.v = e
f.o = g
assert a.t.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.v: B = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: A = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: A = None
        self.x: B = None
        self.y: A = None
        self.txt = txt

m = A("m")
g = B("g")
e = C("e")
j = D("j")
b = E("b")
a = D("a")
d = D("d")
f = B("f")

m.w = a
m.u = e
m.v = f
m.y = d
g.z = b
g.v = e
g.o = f
e.t = b
e.r = m
e.z = a
j.p = e
j.t = m
b.w = m
b.q = m
b.y = m
b.x = g
a.p = e
a.t = m
d.p = e
d.t = m
f.z = b
f.v = e
f.o = g
assert a.t.v.z.txt == "b"