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

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

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

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

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

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

m.x = c
m.t = k
m.q = n
c.y = h
h.p = c
h.z = c
h.o = i
n.u = f
n.x = m
n.p = h
n.o = c
k.r = m
k.v = c
f.p = c
f.z = c
f.o = i
i.r = m
i.v = c
assert m.x.y.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: E = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

m.x = c
m.t = k
m.q = n
c.y = h
h.p = c
h.z = c
h.o = i
n.u = f
n.x = m
n.p = h
n.o = c
k.r = m
k.v = c
f.p = c
f.z = c
f.o = i
i.r = m
i.v = c
assert m.x.y.o.v.txt == "c"