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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: E = None
        self.z: D = None
        self.u: C = None
        self.q: D = None
        self.o: C = None
        self.t: G = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: B = None
        self.v: F = None
        self.s: C = None
        self.z: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: E = None
        self.z: D = None
        self.u: C = None
        self.q: D = None
        self.o: C = None
        self.t: G = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: B = None
        self.v: F = None
        self.s: C = None
        self.z: F = None
        self.txt = txt

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

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