class A:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: C = None
        self.z: E = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: C = None
        self.z: B = None
        self.txt = txt

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

h.o = m
h.p = b
h.z = a
h.w = n
j.r = c
j.w = c
b.v = a
b.r = a
b.y = j
b.t = h
b.u = i
n.y = b
a.p = i
c.z = h
i.z = j
e.v = n
e.z = n
e.t = n
e.q = m
e.y = h
m.t = b
m.v = b
m.z = j
assert m.z.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: C = None
        self.z: E = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: C = None
        self.z: B = None
        self.txt = txt

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

h.o = m
h.p = b
h.z = a
h.w = n
j.r = c
j.w = c
b.v = a
b.r = a
b.y = j
b.t = h
b.u = i
n.y = b
a.p = i
c.z = h
i.z = j
e.v = n
e.z = n
e.t = n
e.q = m
e.y = h
m.t = b
m.v = b
m.z = j
assert m.z.r.z.txt == "h"