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

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

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

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

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

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

l.r = a
l.q = a
l.u = e
l.p = f
f.s = a
f.t = a
f.r = l
f.z = l
e.u = f
d.s = e
a.s = e
a.u = e
a.v = f
j.s = e
assert l.u.u.z.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

l.r = a
l.q = a
l.u = e
l.p = f
f.s = a
f.t = a
f.r = l
f.z = l
e.u = f
d.s = e
a.s = e
a.u = e
a.v = f
j.s = e
assert l.u.u.z.p.t.txt == "a"