class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.z: C = None
        self.q: C = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: E = None
        self.s: F = None
        self.p: E = None
        self.y: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: H = None
        self.v: E = None
        self.t: C = None
        self.y: C = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.r: D = None
        self.p: B = None
        self.u: B = None
        self.s: H = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: A = None
        self.p: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: A = None
        self.y: H = None
        self.t: B = None
        self.x: H = None
        self.q: G = None
        self.txt = txt

f = A("f")
d = B("d")
m = C("m")
i = D("i")
b = E("b")
k = F("k")
h = G("h")
l = H("l")
j = I("j")
c = I("c")

f.u = d
f.t = i
f.z = m
f.q = m
f.w = h
d.o = b
d.q = b
d.p = b
d.s = k
d.y = l
m.t = l
i.x = k
i.w = l
i.v = b
i.t = m
i.y = m
i.s = h
b.w = j
b.r = i
b.p = d
b.u = d
b.q = d
b.s = l
k.q = c
k.y = f
k.p = f
h.w = f
h.o = d
l.o = h
j.z = k
j.u = f
j.y = l
j.x = l
j.t = d
j.q = h
c.z = k
c.u = f
c.y = l
c.x = l
c.t = d
c.q = h
assert m.t.o.w.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.z: C = None
        self.q: C = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: E = None
        self.s: F = None
        self.p: E = None
        self.y: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: H = None
        self.v: E = None
        self.t: C = None
        self.y: C = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.r: D = None
        self.p: B = None
        self.u: B = None
        self.s: H = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: A = None
        self.p: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: A = None
        self.y: H = None
        self.t: B = None
        self.x: H = None
        self.q: G = None
        self.txt = txt

f = A("f")
d = B("d")
m = C("m")
i = D("i")
b = E("b")
k = F("k")
h = G("h")
l = H("l")
j = I("j")
c = I("c")

f.u = d
f.t = i
f.z = m
f.q = m
f.w = h
d.o = b
d.q = b
d.p = b
d.s = k
d.y = l
m.t = l
i.x = k
i.w = l
i.v = b
i.t = m
i.y = m
i.s = h
b.w = j
b.r = i
b.p = d
b.u = d
b.q = d
b.s = l
k.q = c
k.y = f
k.p = f
h.w = f
h.o = d
l.o = h
j.z = k
j.u = f
j.y = l
j.x = l
j.t = d
j.q = h
c.z = k
c.u = f
c.y = l
c.x = l
c.t = d
c.q = h
assert m.t.o.w.w.o.txt == "d"