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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: F = None
        self.w: C = None
        self.s: G = None
        self.o: A = None
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: B = None
        self.o: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: E = None
        self.s: A = None
        self.t: F = None
        self.x: E = None
        self.txt = txt

c = A("c")
h = B("h")
a = C("a")
j = D("j")
d = E("d")
i = F("i")
f = G("f")
g = E("g")
b = E("b")
m = A("m")

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: F = None
        self.w: C = None
        self.s: G = None
        self.o: A = None
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: B = None
        self.o: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: E = None
        self.s: A = None
        self.t: F = None
        self.x: E = None
        self.txt = txt

c = A("c")
h = B("h")
a = C("a")
j = D("j")
d = E("d")
i = F("i")
f = G("f")
g = E("g")
b = E("b")
m = A("m")

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