class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: G = None
        self.q: I = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: D = None
        self.p: D = None
        self.y: H = None
        self.t: D = None
        self.q: D = None
        self.o: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: F = None
        self.p: B = None
        self.z: D = None
        self.txt = txt

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

m.r = i
m.t = e
m.u = e
m.q = h
n.s = m
n.v = c
n.p = c
n.t = c
n.q = c
n.y = i
n.o = e
a.z = c
c.q = h
c.v = n
l.t = d
j.v = c
e.s = m
e.o = j
i.w = c
i.o = d
h.w = m
h.s = j
h.p = n
h.z = c
d.z = c
assert m.r.o.z.v.p.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: G = None
        self.q: I = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: D = None
        self.p: D = None
        self.y: H = None
        self.t: D = None
        self.q: D = None
        self.o: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: F = None
        self.p: B = None
        self.z: D = None
        self.txt = txt

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

m.r = i
m.t = e
m.u = e
m.q = h
n.s = m
n.v = c
n.p = c
n.t = c
n.q = c
n.y = i
n.o = e
a.z = c
c.q = h
c.v = n
l.t = d
j.v = c
e.s = m
e.o = j
i.w = c
i.o = d
h.w = m
h.s = j
h.p = n
h.z = c
d.z = c
assert m.r.o.z.v.p.q.s.txt == "j"