class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: F = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: H = None
        self.z: D = None
        self.x: H = None
        self.v: A = None
        self.y: D = None
        self.s: C = None
        self.w: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: H = None
        self.z: D = None
        self.x: H = None
        self.v: A = None
        self.y: D = None
        self.s: C = None
        self.w: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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