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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: G = None
        self.w: E = None
        self.o: G = None
        self.q: A = None
        self.x: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: D = None
        self.r: A = None
        self.u: B = None
        self.o: H = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: G = None
        self.w: E = None
        self.o: G = None
        self.q: A = None
        self.x: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: D = None
        self.r: A = None
        self.u: B = None
        self.o: H = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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