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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: B = None
        self.q: A = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: B = None
        self.q: A = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: B = None
        self.txt = txt

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

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