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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: G = None
        self.u: C = None
        self.t: E = None
        self.s: G = None
        self.o: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: D = None
        self.z: B = None
        self.q: D = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: C = None
        self.w: C = None
        self.p: F = None
        self.z: E = None
        self.txt = txt

f = A("f")
m = B("m")
c = C("c")
i = D("i")
d = E("d")
k = F("k")
g = G("g")
l = H("l")
a = D("a")

f.w = m
f.q = c
f.r = d
f.s = g
m.v = i
m.r = g
m.s = g
m.u = c
m.t = d
m.o = k
c.w = g
i.q = g
i.x = g
i.u = d
i.w = d
i.p = f
d.s = f
d.t = i
k.o = m
k.z = m
k.x = a
k.q = i
k.w = c
g.p = l
l.u = c
l.r = c
l.w = c
l.p = k
l.z = d
a.q = g
a.x = g
a.u = d
a.w = d
a.p = f
assert m.o.q.w.s.s.p.z.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.r: E = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: G = None
        self.u: C = None
        self.t: E = None
        self.s: G = None
        self.o: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: D = None
        self.z: B = None
        self.q: D = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: C = None
        self.w: C = None
        self.p: F = None
        self.z: E = None
        self.txt = txt

f = A("f")
m = B("m")
c = C("c")
i = D("i")
d = E("d")
k = F("k")
g = G("g")
l = H("l")
a = D("a")

f.w = m
f.q = c
f.r = d
f.s = g
m.v = i
m.r = g
m.s = g
m.u = c
m.t = d
m.o = k
c.w = g
i.q = g
i.x = g
i.u = d
i.w = d
i.p = f
d.s = f
d.t = i
k.o = m
k.z = m
k.x = a
k.q = i
k.w = c
g.p = l
l.u = c
l.r = c
l.w = c
l.p = k
l.z = d
a.q = g
a.x = g
a.u = d
a.w = d
a.p = f
assert m.o.q.w.s.s.p.z.t.q.txt == "g"