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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: F = None
        self.u: C = None
        self.x: E = None
        self.p: A = None
        self.txt = txt

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

b = A("b")
i = B("i")
k = C("k")
h = D("h")
l = E("l")
d = F("d")
c = G("c")
g = H("g")
m = D("m")

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: F = None
        self.u: C = None
        self.x: E = None
        self.p: A = None
        self.txt = txt

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

b = A("b")
i = B("i")
k = C("k")
h = D("h")
l = E("l")
d = F("d")
c = G("c")
g = H("g")
m = D("m")

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