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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: D = None
        self.p: F = None
        self.s: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: I = None
        self.o: D = None
        self.p: B = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: B = None
        self.p: A = None
        self.w: H = None
        self.r: D = None
        self.z: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: B = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: D = None
        self.p: F = None
        self.s: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: I = None
        self.o: D = None
        self.p: B = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: B = None
        self.p: A = None
        self.w: H = None
        self.r: D = None
        self.z: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: B = None
        self.s: A = None
        self.txt = txt

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

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