class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: E = None
        self.v: E = None
        self.p: B = None
        self.y: D = None
        self.o: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: F = None
        self.y: F = None
        self.v: A = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: G = None
        self.r: A = None
        self.s: H = None
        self.o: G = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: H = None
        self.v: E = None
        self.q: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: F = None
        self.y: F = None
        self.v: A = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: G = None
        self.r: A = None
        self.s: H = None
        self.o: G = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: H = None
        self.v: E = None
        self.q: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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