class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: E = None
        self.x: A = None
        self.w: A = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: C = None
        self.o: G = None
        self.q: I = None
        self.x: F = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: B = None
        self.r: C = None
        self.t: A = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: E = None
        self.x: A = None
        self.w: A = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: C = None
        self.o: G = None
        self.q: I = None
        self.x: F = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: B = None
        self.r: C = None
        self.t: A = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: B = None
        self.txt = txt

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

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