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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: A = None
        self.o: A = None
        self.z: F = None
        self.t: H = None
        self.y: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: F = None
        self.u: E = None
        self.v: B = None
        self.z: H = None
        self.w: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: A = None
        self.o: A = None
        self.z: F = None
        self.t: H = None
        self.y: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: F = None
        self.u: E = None
        self.v: B = None
        self.z: H = None
        self.w: A = None
        self.txt = txt

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

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