class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: C = None
        self.t: F = None
        self.r: C = None
        self.p: H = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.x: B = None
        self.v: H = None
        self.r: B = None
        self.p: D = None
        self.y: D = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: E = None
        self.u: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: C = None
        self.t: F = None
        self.r: C = None
        self.p: H = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.x: B = None
        self.v: H = None
        self.r: B = None
        self.p: D = None
        self.y: D = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: E = None
        self.u: D = None
        self.txt = txt

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

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

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