class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: G = None
        self.r: G = None
        self.t: G = None
        self.p: H = None
        self.y: H = None
        self.x: G = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: E = None
        self.p: A = None
        self.w: E = None
        self.z: D = None
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: B = None
        self.p: A = None
        self.t: H = None
        self.q: G = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: E = None
        self.p: A = None
        self.w: E = None
        self.z: D = None
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: B = None
        self.p: A = None
        self.t: H = None
        self.q: G = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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