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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: F = None
        self.t: A = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: E = None
        self.txt = txt

m = A("m")
e = B("e")
b = C("b")
d = D("d")
h = E("h")
c = F("c")
l = G("l")
k = A("k")
i = D("i")

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: F = None
        self.t: A = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: E = None
        self.txt = txt

m = A("m")
e = B("e")
b = C("b")
d = D("d")
h = E("h")
c = F("c")
l = G("l")
k = A("k")
i = D("i")

m.s = l
m.z = h
m.q = c
e.p = l
b.r = l
b.y = c
b.t = m
b.s = h
d.v = b
d.q = b
d.s = h
d.p = h
d.r = e
d.t = e
d.o = c
h.z = l
h.o = k
c.y = k
c.t = d
l.y = b
l.u = h
k.s = l
k.z = h
k.q = c
i.v = b
i.q = b
i.s = h
i.p = h
i.r = e
i.t = e
i.o = c
assert m.s.u.z.u.o.q.txt == "c"