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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: G = None
        self.z: C = None
        self.w: H = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.t: G = None
        self.u: D = None
        self.r: E = None
        self.v: A = None
        self.q: F = None
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: G = None
        self.z: C = None
        self.w: H = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.t: G = None
        self.u: D = None
        self.r: E = None
        self.v: A = None
        self.q: F = None
        self.o: A = None
        self.txt = txt

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

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