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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: B = None
        self.t: B = None
        self.u: D = None
        self.w: C = None
        self.txt = txt

e = A("e")
l = B("l")
f = C("f")
a = D("a")
c = E("c")
k = B("k")

e.x = c
e.r = c
l.q = c
f.t = a
f.x = a
f.s = k
a.u = f
a.p = l
a.y = e
a.z = e
a.x = k
c.v = a
c.u = a
c.x = l
c.t = k
c.w = f
k.q = c
assert k.q.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: B = None
        self.t: B = None
        self.u: D = None
        self.w: C = None
        self.txt = txt

e = A("e")
l = B("l")
f = C("f")
a = D("a")
c = E("c")
k = B("k")

e.x = c
e.r = c
l.q = c
f.t = a
f.x = a
f.s = k
a.u = f
a.p = l
a.y = e
a.z = e
a.x = k
c.v = a
c.u = a
c.x = l
c.t = k
c.w = f
k.q = c
assert k.q.w.t.txt == "a"