class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: E = None
        self.q: D = None
        self.t: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: B = None
        self.p: F = None
        self.u: A = None
        self.q: B = None
        self.v: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: I = None
        self.t: E = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: C = None
        self.r: A = None
        self.u: F = None
        self.v: C = None
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: E = None
        self.o: C = None
        self.z: B = None
        self.q: C = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: B = None
        self.p: F = None
        self.u: A = None
        self.q: B = None
        self.v: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: I = None
        self.t: E = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: C = None
        self.r: A = None
        self.u: F = None
        self.v: C = None
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: E = None
        self.o: C = None
        self.z: B = None
        self.q: C = None
        self.p: G = None
        self.txt = txt

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

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