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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: F = None
        self.w: A = None
        self.s: E = None
        self.y: H = None
        self.r: F = None
        self.u: F = None
        self.p: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: F = None
        self.u: B = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: C = None
        self.q: H = None
        self.u: H = None
        self.o: F = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: C = None
        self.u: C = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: F = None
        self.w: A = None
        self.s: E = None
        self.y: H = None
        self.r: F = None
        self.u: F = None
        self.p: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: F = None
        self.u: B = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: C = None
        self.q: H = None
        self.u: H = None
        self.o: F = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: C = None
        self.u: C = None
        self.y: B = None
        self.txt = txt

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

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

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

l.q = d
d.x = h
d.y = h
d.p = h
d.o = m
d.r = m
d.u = m
d.w = l
d.s = n
e.s = a
e.q = h
e.x = h
e.o = h
e.r = l
k.y = h
k.p = h
k.r = m
k.u = d
n.z = h
n.q = h
n.u = h
n.x = h
n.r = e
n.o = m
m.q = a
m.o = e
m.u = e
m.y = d
a.x = m
a.q = n
h.o = l
h.x = l
h.y = d
h.w = m
h.p = a
assert l.q.o.q.q.o.y.o.txt == "m"