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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: G = None
        self.q: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: C = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

i = A("i")
b = B("b")
k = C("k")
a = D("a")
m = E("m")
c = F("c")
h = G("h")
e = H("e")
j = H("j")
g = H("g")

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: G = None
        self.q: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: C = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

i = A("i")
b = B("b")
k = C("k")
a = D("a")
m = E("m")
c = F("c")
h = G("h")
e = H("e")
j = H("j")
g = H("g")

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