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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.z: D = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: I = None
        self.t: G = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: H = None
        self.v: E = None
        self.w: C = None
        self.u: B = None
        self.p: F = None
        self.t: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.z: D = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: I = None
        self.t: G = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: H = None
        self.v: E = None
        self.w: C = None
        self.u: B = None
        self.p: F = None
        self.t: G = None
        self.txt = txt

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

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