class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: G = None
        self.t: B = None
        self.p: H = None
        self.z: F = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: B = None
        self.p: C = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.q: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: B = None
        self.p: C = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.q: C = None
        self.txt = txt

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

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