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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: C = None
        self.v: H = None
        self.w: A = None
        self.t: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: A = None
        self.q: B = None
        self.z: C = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: G = None
        self.v: C = None
        self.t: F = None
        self.p: E = None
        self.y: A = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: C = None
        self.v: H = None
        self.w: A = None
        self.t: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: A = None
        self.q: B = None
        self.z: C = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: G = None
        self.v: C = None
        self.t: F = None
        self.p: E = None
        self.y: A = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

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