class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: D = None
        self.y: F = None
        self.v: H = None
        self.r: H = None
        self.q: F = None
        self.u: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

c.w = d
c.z = d
e.t = m
e.v = c
e.r = n
e.w = k
e.o = d
m.z = k
m.y = d
m.w = d
m.q = c
g.q = k
g.z = e
g.o = e
g.u = c
g.x = n
g.y = m
l.p = c
l.t = g
l.y = k
l.q = k
l.v = d
l.r = d
l.u = d
k.y = l
k.p = d
k.t = d
k.r = c
k.x = c
k.u = c
k.s = c
k.o = e
n.x = e
d.z = m
d.o = n
d.p = k
d.w = g
assert d.p.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: D = None
        self.y: F = None
        self.v: H = None
        self.r: H = None
        self.q: F = None
        self.u: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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