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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: G = None
        self.u: A = None
        self.z: A = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: G = None
        self.q: I = None
        self.w: C = None
        self.o: B = None
        self.z: I = None
        self.r: G = None
        self.v: B = None
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: D = None
        self.u: H = None
        self.q: G = None
        self.z: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: F = None
        self.z: F = None
        self.r: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: G = None
        self.u: A = None
        self.z: A = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: G = None
        self.q: I = None
        self.w: C = None
        self.o: B = None
        self.z: I = None
        self.r: G = None
        self.v: B = None
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: D = None
        self.u: H = None
        self.q: G = None
        self.z: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: F = None
        self.z: F = None
        self.r: E = None
        self.txt = txt

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

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