class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: E = None
        self.r: F = None
        self.w: C = None
        self.x: G = None
        self.z: I = None
        self.t: E = None
        self.p: I = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: 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.s: C = None
        self.r: G = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: D = None
        self.o: B = None
        self.u: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: G = None
        self.x: C = None
        self.q: G = None
        self.y: G = None
        self.u: G = None
        self.s: C = None
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: E = None
        self.r: F = None
        self.w: C = None
        self.x: G = None
        self.z: I = None
        self.t: E = None
        self.p: I = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: 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.s: C = None
        self.r: G = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: D = None
        self.o: B = None
        self.u: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: G = None
        self.x: C = None
        self.q: G = None
        self.y: G = None
        self.u: G = None
        self.s: C = None
        self.o: G = None
        self.txt = txt

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

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