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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: A = None
        self.s: G = None
        self.q: A = None
        self.x: E = None
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: A = None
        self.x: D = None
        self.t: C = None
        self.z: C = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: C = None
        self.y: D = None
        self.v: A = None
        self.t: E = None
        self.s: H = None
        self.z: C = None
        self.x: A = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
m = C("m")
i = D("i")
j = E("j")
h = F("h")
d = G("d")
n = H("n")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: A = None
        self.s: G = None
        self.q: A = None
        self.x: E = None
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: A = None
        self.x: D = None
        self.t: C = None
        self.z: C = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: C = None
        self.y: D = None
        self.v: A = None
        self.t: E = None
        self.s: H = None
        self.z: C = None
        self.x: A = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
m = C("m")
i = D("i")
j = E("j")
h = F("h")
d = G("d")
n = H("n")

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