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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.w: E = None
        self.z: A = None
        self.p: E = None
        self.txt = txt

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

i.z = c
i.y = m
i.x = h
i.p = h
i.o = h
m.s = h
m.v = h
m.o = c
c.s = j
c.v = j
h.x = n
h.v = c
j.y = c
j.s = c
j.w = n
j.p = n
j.z = i
n.y = c
n.s = c
n.w = j
n.p = j
n.z = i
assert m.o.s.y.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: B = None
        self.x: D = None
        self.p: D = None
        self.o: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.w: E = None
        self.z: A = None
        self.p: E = None
        self.txt = txt

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

i.z = c
i.y = m
i.x = h
i.p = h
i.o = h
m.s = h
m.v = h
m.o = c
c.s = j
c.v = j
h.x = n
h.v = c
j.y = c
j.s = c
j.w = n
j.p = n
j.z = i
n.y = c
n.s = c
n.w = j
n.p = j
n.z = i
assert m.o.s.y.s.s.s.txt == "j"