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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: A = None
        self.r: G = None
        self.v: B = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: A = None
        self.r: G = None
        self.v: B = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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