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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: I = None
        self.u: G = None
        self.w: B = None
        self.z: F = None
        self.y: G = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: A = None
        self.z: B = None
        self.q: A = None
        self.s: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: I = None
        self.u: G = None
        self.w: B = None
        self.z: F = None
        self.y: G = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: A = None
        self.z: B = None
        self.q: A = None
        self.s: C = None
        self.txt = txt

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

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