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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: C = None
        self.y: G = None
        self.u: B = None
        self.w: J = None
        self.t: I = None
        self.p: G = None
        self.q: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: D = None
        self.p: G = None
        self.w: C = None
        self.q: A = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.x: E = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: J = None
        self.o: E = None
        self.t: J = None
        self.q: C = None
        self.y: C = None
        self.z: H = None
        self.r: J = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: C = None
        self.y: G = None
        self.u: B = None
        self.w: J = None
        self.t: I = None
        self.p: G = None
        self.q: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: D = None
        self.p: G = None
        self.w: C = None
        self.q: A = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.x: E = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: J = None
        self.o: E = None
        self.t: J = None
        self.q: C = None
        self.y: C = None
        self.z: H = None
        self.r: J = None
        self.txt = txt

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

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

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

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

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