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

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

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

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

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

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

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

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

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

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

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

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

e.p = a
e.u = a
e.r = k
l.x = e
l.z = a
l.s = a
k.p = e
k.o = e
k.y = e
k.w = l
k.u = j
j.v = l
a.w = k
assert j.v.x.p.w.txt == "k"