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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: B = None
        self.w: C = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: B = None
        self.w: C = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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