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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.v: F = None
        self.z: A = None
        self.t: F = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.z: C = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: G = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.u: B = None
        self.q: H = None
        self.o: D = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: G = None
        self.y: G = None
        self.txt = txt

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

g.q = j
g.z = h
g.r = a
g.w = m
l.x = m
l.t = n
e.o = g
e.u = g
e.z = g
e.v = f
e.t = m
e.q = n
h.v = m
h.x = m
h.q = a
h.z = i
a.q = h
a.s = i
a.r = l
m.t = l
m.u = n
m.q = h
n.t = l
n.z = l
n.u = l
n.q = j
n.o = h
n.v = h
j.r = g
j.s = n
j.y = n
f.t = l
f.u = n
f.q = h
i.o = g
i.u = g
i.z = g
i.v = f
i.t = f
i.q = n
assert m.q.x.u.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: D = None
        self.r: E = None
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.v: F = None
        self.z: A = None
        self.t: F = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.z: C = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: G = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.u: B = None
        self.q: H = None
        self.o: D = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: G = None
        self.y: G = None
        self.txt = txt

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

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