class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: H = None
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: A = None
        self.q: G = None
        self.u: B = None
        self.r: B = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: G = None
        self.x: A = None
        self.w: G = None
        self.o: B = None
        self.r: G = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: H = None
        self.u: H = None
        self.y: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: H = None
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: A = None
        self.q: G = None
        self.u: B = None
        self.r: B = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: G = None
        self.x: A = None
        self.w: G = None
        self.o: B = None
        self.r: G = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: H = None
        self.u: H = None
        self.y: H = None
        self.txt = txt

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

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