class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: I = None
        self.u: G = None
        self.p: C = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: G = None
        self.y: I = None
        self.x: H = None
        self.u: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: I = None
        self.r: A = None
        self.p: H = None
        self.o: H = None
        self.t: G = None
        self.u: I = None
        self.z: A = None
        self.s: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: I = None
        self.q: E = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: G = None
        self.y: I = None
        self.x: H = None
        self.u: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: I = None
        self.r: A = None
        self.p: H = None
        self.o: H = None
        self.t: G = None
        self.u: I = None
        self.z: A = None
        self.s: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: I = None
        self.q: E = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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