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

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

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

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

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

i = A("i")
l = B("l")
m = C("m")
c = D("c")
d = E("d")
f = E("f")
h = C("h")
e = D("e")
n = E("n")

i.s = c
i.q = l
i.v = f
l.o = i
l.x = i
l.t = e
l.u = f
m.s = h
m.v = h
c.z = e
c.x = m
c.w = l
d.x = e
d.z = n
d.w = n
d.o = n
f.x = c
f.z = n
f.w = n
f.o = n
h.s = m
h.v = m
e.z = c
e.x = m
e.w = l
n.x = e
n.z = d
n.w = f
n.o = f
assert h.v.s.s.s.v.s.s.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: B = None
        self.v: E = None
        self.txt = txt

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

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

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

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

i = A("i")
l = B("l")
m = C("m")
c = D("c")
d = E("d")
f = E("f")
h = C("h")
e = D("e")
n = E("n")

i.s = c
i.q = l
i.v = f
l.o = i
l.x = i
l.t = e
l.u = f
m.s = h
m.v = h
c.z = e
c.x = m
c.w = l
d.x = e
d.z = n
d.w = n
d.o = n
f.x = c
f.z = n
f.w = n
f.o = n
h.s = m
h.v = m
e.z = c
e.x = m
e.w = l
n.x = e
n.z = d
n.w = f
n.o = f
assert h.v.s.s.s.v.s.s.v.s.txt == "m"