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

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

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

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

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

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

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

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

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

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

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

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

j.y = e
j.s = e
j.u = k
j.w = d
d.v = e
k.u = d
k.p = d
k.z = a
k.q = j
a.w = e
e.t = d
e.u = d
e.r = a
e.o = a
e.q = a
assert a.w.q.w.o.txt == "a"