class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: I = None
        self.r: E = None
        self.y: G = None
        self.w: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: D = None
        self.s: H = None
        self.y: C = None
        self.u: G = None
        self.v: G = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: B = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: I = None
        self.r: E = None
        self.y: G = None
        self.w: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: D = None
        self.s: H = None
        self.y: C = None
        self.u: G = None
        self.v: G = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: B = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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