class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: A = None
        self.z: A = None
        self.r: H = None
        self.q: A = None
        self.v: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: G = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: A = None
        self.z: A = None
        self.r: H = None
        self.q: A = None
        self.v: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: G = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: G = None
        self.txt = txt

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

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