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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: I = None
        self.v: I = None
        self.o: G = None
        self.p: I = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: E = None
        self.u: H = None
        self.t: F = None
        self.z: G = None
        self.x: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: G = None
        self.p: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: I = None
        self.v: I = None
        self.o: G = None
        self.p: I = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: E = None
        self.u: H = None
        self.t: F = None
        self.z: G = None
        self.x: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: G = None
        self.p: E = None
        self.txt = txt

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

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