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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.u: G = None
        self.r: A = None
        self.txt = txt

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

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

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

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

i = A("i")
e = B("e")
b = C("b")
a = D("a")
d = E("d")
c = F("c")
m = G("m")
f = H("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.u: G = None
        self.r: A = None
        self.txt = txt

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

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

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

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

i = A("i")
e = B("e")
b = C("b")
a = D("a")
d = E("d")
c = F("c")
m = G("m")
f = H("f")

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