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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: H = None
        self.z: D = None
        self.q: I = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.o: H = None
        self.v: C = None
        self.w: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: H = None
        self.z: D = None
        self.q: I = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.o: H = None
        self.v: C = None
        self.w: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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