class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: E = None
        self.v: D = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: E = None
        self.s: B = None
        self.r: E = None
        self.txt = txt

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

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

f = A("f")
m = B("m")
l = C("l")
j = D("j")
d = E("d")
a = A("a")

f.w = d
f.x = d
f.p = d
f.v = j
m.t = l
l.z = m
l.s = m
l.x = d
l.r = d
j.p = m
j.x = m
j.u = m
j.z = l
j.t = l
d.r = j
d.u = f
a.w = d
a.x = d
a.p = d
a.v = j
assert f.v.t.x.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: E = None
        self.v: D = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: E = None
        self.s: B = None
        self.r: E = None
        self.txt = txt

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

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

f = A("f")
m = B("m")
l = C("l")
j = D("j")
d = E("d")
a = A("a")

f.w = d
f.x = d
f.p = d
f.v = j
m.t = l
l.z = m
l.s = m
l.x = d
l.r = d
j.p = m
j.x = m
j.u = m
j.z = l
j.t = l
d.r = j
d.u = f
a.w = d
a.x = d
a.p = d
a.v = j
assert f.v.t.x.u.x.txt == "d"