class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: I = None
        self.q: F = None
        self.p: I = None
        self.w: D = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: F = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: A = None
        self.o: H = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: C = None
        self.t: A = None
        self.s: E = None
        self.o: C = None
        self.txt = txt

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

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

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

l.w = n
l.q = m
l.p = m
n.u = l
n.v = h
n.p = h
n.q = b
n.w = c
n.o = g
e.y = m
e.r = b
e.p = n
c.w = g
m.q = n
m.z = l
m.o = g
m.x = b
b.z = m
b.x = n
j.r = c
j.v = e
j.o = e
j.t = l
j.s = m
g.v = n
h.s = e
h.z = j
assert c.w.v.u.w.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: I = None
        self.q: F = None
        self.p: I = None
        self.w: D = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: F = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: A = None
        self.o: H = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: C = None
        self.t: A = None
        self.s: E = None
        self.o: C = None
        self.txt = txt

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

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

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

l.w = n
l.q = m
l.p = m
n.u = l
n.v = h
n.p = h
n.q = b
n.w = c
n.o = g
e.y = m
e.r = b
e.p = n
c.w = g
m.q = n
m.z = l
m.o = g
m.x = b
b.z = m
b.x = n
j.r = c
j.v = e
j.o = e
j.t = l
j.s = m
g.v = n
h.s = e
h.z = j
assert c.w.v.u.w.q.z.txt == "m"