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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: A = None
        self.q: A = None
        self.p: A = None
        self.r: I = None
        self.o: B = None
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: G = None
        self.y: I = None
        self.q: D = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: A = None
        self.q: A = None
        self.p: A = None
        self.r: I = None
        self.o: B = None
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: G = None
        self.y: I = None
        self.q: D = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

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

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

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