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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: E = None
        self.p: A = None
        self.u: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: E = None
        self.p: A = None
        self.u: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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