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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: G = None
        self.v: J = None
        self.o: A = None
        self.r: E = None
        self.p: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: H = None
        self.u: J = None
        self.p: F = None
        self.txt = txt

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

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

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

d = A("d")
m = B("m")
l = C("l")
k = D("k")
n = E("n")
j = F("j")
e = G("e")
h = H("h")
c = I("c")
i = J("i")

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: G = None
        self.v: J = None
        self.o: A = None
        self.r: E = None
        self.p: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: H = None
        self.u: J = None
        self.p: F = None
        self.txt = txt

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

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

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

d = A("d")
m = B("m")
l = C("l")
k = D("k")
n = E("n")
j = F("j")
e = G("e")
h = H("h")
c = I("c")
i = J("i")

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