class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: I = None
        self.q: B = None
        self.z: D = None
        self.p: D = None
        self.o: G = None
        self.v: E = None
        self.w: I = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.z: A = None
        self.s: B = None
        self.q: E = None
        self.p: G = None
        self.t: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

d.x = n
d.t = b
d.w = b
d.q = a
d.z = e
d.p = e
d.o = g
d.v = l
d.s = m
a.w = b
a.v = n
c.s = b
e.x = d
e.z = d
e.v = i
e.s = a
e.q = l
e.t = l
e.p = g
l.u = a
m.u = e
m.o = e
g.u = m
n.q = c
b.q = a
b.z = m
i.s = b
assert m.u.p.u.o.x.w.q.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: I = None
        self.q: B = None
        self.z: D = None
        self.p: D = None
        self.o: G = None
        self.v: E = None
        self.w: I = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.z: A = None
        self.s: B = None
        self.q: E = None
        self.p: G = None
        self.t: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

d.x = n
d.t = b
d.w = b
d.q = a
d.z = e
d.p = e
d.o = g
d.v = l
d.s = m
a.w = b
a.v = n
c.s = b
e.x = d
e.z = d
e.v = i
e.s = a
e.q = l
e.t = l
e.p = g
l.u = a
m.u = e
m.o = e
g.u = m
n.q = c
b.q = a
b.z = m
i.s = b
assert m.u.p.u.o.x.w.q.w.z.txt == "m"