class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

l = A("l")
j = B("j")
m = C("m")
i = D("i")
c = E("c")
b = D("b")
f = A("f")
g = A("g")

l.z = g
l.w = m
l.t = m
j.p = f
j.y = m
j.u = c
m.x = c
m.o = c
m.s = c
m.v = j
m.z = j
i.p = c
i.v = c
c.t = b
b.p = c
b.v = c
f.z = g
f.w = m
f.t = m
g.z = l
g.w = m
g.t = m
assert j.p.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

l = A("l")
j = B("j")
m = C("m")
i = D("i")
c = E("c")
b = D("b")
f = A("f")
g = A("g")

l.z = g
l.w = m
l.t = m
j.p = f
j.y = m
j.u = c
m.x = c
m.o = c
m.s = c
m.v = j
m.z = j
i.p = c
i.v = c
c.t = b
b.p = c
b.v = c
f.z = g
f.w = m
f.t = m
g.z = l
g.w = m
g.t = m
assert j.p.z.z.txt == "l"