class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: F = None
        self.u: G = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: H = None
        self.u: A = None
        self.r: D = None
        self.y: D = None
        self.z: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.y: E = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: H = None
        self.u: A = None
        self.r: D = None
        self.y: D = None
        self.z: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.y: E = None
        self.z: E = None
        self.txt = txt

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

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

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

a.q = l
a.u = l
a.w = h
a.r = b
b.u = h
b.y = h
c.v = i
c.r = i
c.y = i
c.p = e
c.u = a
c.z = a
i.s = l
i.p = c
i.x = m
m.y = a
h.q = b
h.v = m
h.y = m
h.z = m
l.x = i
l.z = c
e.x = l
e.w = i
e.o = a
assert e.x.z.y.s.z.txt == "c"