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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: H = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: E = None
        self.q: A = None
        self.x: A = None
        self.s: E = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: A = None
        self.w: B = None
        self.z: F = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: D = None
        self.w: B = None
        self.x: B = None
        self.o: H = None
        self.v: C = None
        self.y: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: H = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: E = None
        self.q: A = None
        self.x: A = None
        self.s: E = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: A = None
        self.w: B = None
        self.z: F = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: D = None
        self.w: B = None
        self.x: B = None
        self.o: H = None
        self.v: C = None
        self.y: E = None
        self.txt = txt

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

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