class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.u: F = None
        self.q: F = None
        self.r: F = None
        self.x: H = None
        self.v: F = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.u: F = None
        self.q: F = None
        self.r: F = None
        self.x: H = None
        self.v: F = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

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

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