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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: A = None
        self.o: D = None
        self.txt = txt

m = A("m")
h = B("h")
d = C("d")
g = D("g")
l = E("l")
c = F("c")
i = G("i")
n = G("n")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: A = None
        self.o: D = None
        self.txt = txt

m = A("m")
h = B("h")
d = C("d")
g = D("g")
l = E("l")
c = F("c")
i = G("i")
n = G("n")

m.u = l
h.u = d
d.v = g
d.x = m
d.o = h
d.s = l
g.z = l
g.s = m
l.q = n
l.s = c
l.u = i
l.t = g
l.p = g
l.z = d
l.r = h
c.z = m
i.x = l
i.y = m
i.o = g
n.x = l
n.y = m
n.o = g
assert h.u.s.z.v.s.u.t.z.txt == "l"