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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: E = None
        self.p: H = None
        self.v: E = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.t: F = None
        self.s: G = None
        self.u: F = None
        self.txt = txt

d = A("d")
l = B("l")
g = C("g")
a = D("a")
h = E("h")
c = F("c")
e = G("e")
b = H("b")

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: E = None
        self.p: H = None
        self.v: E = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.t: F = None
        self.s: G = None
        self.u: F = None
        self.txt = txt

d = A("d")
l = B("l")
g = C("g")
a = D("a")
h = E("h")
c = F("c")
e = G("e")
b = H("b")

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