class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: H = None
        self.x: F = None
        self.q: E = None
        self.y: C = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: E = None
        self.y: H = None
        self.z: B = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: I = None
        self.q: D = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: A = None
        self.v: G = None
        self.o: I = None
        self.u: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: C = None
        self.y: D = None
        self.o: G = None
        self.s: E = None
        self.v: B = None
        self.z: G = None
        self.q: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: H = None
        self.x: F = None
        self.q: E = None
        self.y: C = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: E = None
        self.y: H = None
        self.z: B = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: I = None
        self.q: D = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: A = None
        self.v: G = None
        self.o: I = None
        self.u: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: C = None
        self.y: D = None
        self.o: G = None
        self.s: E = None
        self.v: B = None
        self.z: G = None
        self.q: G = None
        self.txt = txt

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

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