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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.q: C = None
        self.u: D = None
        self.t: C = None
        self.o: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: E = None
        self.o: A = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: E = None
        self.u: A = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: H = None
        self.x: A = None
        self.y: E = None
        self.txt = txt

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

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

a = A("a")
b = B("b")
l = C("l")
n = D("n")
f = E("f")
g = F("g")
c = G("c")
i = H("i")
d = I("d")
j = H("j")

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.q: C = None
        self.u: D = None
        self.t: C = None
        self.o: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: E = None
        self.o: A = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: E = None
        self.u: A = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: H = None
        self.x: A = None
        self.y: E = None
        self.txt = txt

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

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

a = A("a")
b = B("b")
l = C("l")
n = D("n")
f = E("f")
g = F("g")
c = G("c")
i = H("i")
d = I("d")
j = H("j")

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