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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: B = None
        self.o: F = None
        self.p: F = None
        self.s: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: B = None
        self.s: C = None
        self.o: F = None
        self.r: I = None
        self.q: H = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: J = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: E = None
        self.v: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: B = None
        self.o: F = None
        self.p: F = None
        self.s: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: B = None
        self.s: C = None
        self.o: F = None
        self.r: I = None
        self.q: H = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: J = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: E = None
        self.v: H = None
        self.txt = txt

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

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

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