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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

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