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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: G = None
        self.y: G = None
        self.q: G = None
        self.o: I = None
        self.p: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: F = None
        self.r: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: C = None
        self.z: I = None
        self.r: E = None
        self.o: D = None
        self.q: B = None
        self.x: B = None
        self.t: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: B = None
        self.x: G = None
        self.txt = txt

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

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

m.w = k
m.o = l
n.t = k
n.o = k
n.p = k
n.u = a
n.y = a
n.q = a
g.x = k
g.r = k
g.w = l
d.o = n
d.w = n
d.z = n
d.r = h
j.o = a
l.u = d
l.o = d
l.y = g
l.z = k
l.r = j
l.q = n
l.x = n
l.t = n
a.u = g
a.x = l
h.p = m
h.w = n
h.x = a
k.q = n
k.u = n
k.w = m
k.x = j
assert g.w.o.r.p.o.z.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: G = None
        self.y: G = None
        self.q: G = None
        self.o: I = None
        self.p: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: F = None
        self.r: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: C = None
        self.z: I = None
        self.r: E = None
        self.o: D = None
        self.q: B = None
        self.x: B = None
        self.t: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: B = None
        self.x: G = None
        self.txt = txt

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

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

m.w = k
m.o = l
n.t = k
n.o = k
n.p = k
n.u = a
n.y = a
n.q = a
g.x = k
g.r = k
g.w = l
d.o = n
d.w = n
d.z = n
d.r = h
j.o = a
l.u = d
l.o = d
l.y = g
l.z = k
l.r = j
l.q = n
l.x = n
l.t = n
a.u = g
a.x = l
h.p = m
h.w = n
h.x = a
k.q = n
k.u = n
k.w = m
k.x = j
assert g.w.o.r.p.o.z.w.w.w.txt == "m"