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

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: G = None
        self.z: H = None
        self.u: H = None
        self.t: I = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: H = None
        self.z: A = None
        self.u: F = None
        self.o: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: E = None
        self.s: C = None
        self.p: D = None
        self.u: I = None
        self.r: I = None
        self.t: C = None
        self.q: I = None
        self.y: I = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: G = None
        self.z: H = None
        self.u: H = None
        self.t: I = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: H = None
        self.z: A = None
        self.u: F = None
        self.o: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: E = None
        self.s: C = None
        self.p: D = None
        self.u: I = None
        self.r: I = None
        self.t: C = None
        self.q: I = None
        self.y: I = None
        self.txt = txt

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

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

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

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