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

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

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

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

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

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

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

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

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

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

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

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

i.p = l
i.w = l
i.v = c
i.x = c
c.z = m
c.s = l
l.t = k
l.p = c
l.u = m
l.r = j
m.t = i
m.p = l
m.o = l
j.s = k
h.s = k
k.s = h
assert l.p.s.p.txt == "c"