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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: F = None
        self.v: F = None
        self.t: C = None
        self.z: H = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: G = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: B = None
        self.y: I = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: F = None
        self.v: F = None
        self.t: C = None
        self.z: H = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: G = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: B = None
        self.y: I = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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