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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: B = None
        self.v: A = None
        self.t: D = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: B = None
        self.v: A = None
        self.t: D = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: E = None
        self.txt = txt

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

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

c.s = j
c.t = e
c.x = k
c.z = k
l.t = j
l.w = j
l.x = d
l.q = d
k.y = j
k.s = l
k.v = c
k.r = c
k.t = e
e.z = l
e.o = j
j.p = l
d.y = j
d.s = l
d.v = c
d.r = c
d.t = e
assert e.z.t.p.txt == "l"