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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.t: B = None
        self.o: D = None
        self.txt = txt

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

j.r = e
j.z = e
j.s = e
j.q = f
b.q = e
b.x = e
b.p = e
b.u = a
a.o = b
f.t = e
e.u = a
e.q = a
e.t = b
e.o = f
assert f.t.t.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: E = None
        self.s: E = None
        self.q: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.t: B = None
        self.o: D = None
        self.txt = txt

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

j.r = e
j.z = e
j.s = e
j.q = f
b.q = e
b.x = e
b.p = e
b.u = a
a.o = b
f.t = e
e.u = a
e.q = a
e.t = b
e.o = f
assert f.t.t.p.u.txt == "a"