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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: E = None
        self.z: C = None
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: G = None
        self.p: E = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: E = None
        self.z: C = None
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: G = None
        self.p: E = None
        self.y: A = None
        self.txt = txt

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

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