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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: D = None
        self.v: C = None
        self.o: A = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: A = None
        self.p: A = None
        self.txt = txt

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

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

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

j.p = k
j.z = e
k.x = c
k.v = c
k.p = c
k.t = i
k.o = j
c.w = k
c.v = j
c.p = j
i.v = c
i.o = j
i.p = k
l.w = k
l.x = k
l.z = c
l.t = c
l.r = e
e.w = k
e.x = k
e.z = c
e.t = c
e.r = l
assert l.w.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: D = None
        self.v: C = None
        self.o: A = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: A = None
        self.p: A = None
        self.txt = txt

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

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

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

j.p = k
j.z = e
k.x = c
k.v = c
k.p = c
k.t = i
k.o = j
c.w = k
c.v = j
c.p = j
i.v = c
i.o = j
i.p = k
l.w = k
l.x = k
l.z = c
l.t = c
l.r = e
e.w = k
e.x = k
e.z = c
e.t = c
e.r = l
assert l.w.o.z.txt == "e"