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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: E = None
        self.p: B = None
        self.x: G = None
        self.v: G = None
        self.u: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: F = None
        self.w: D = None
        self.q: B = None
        self.x: F = None
        self.t: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: E = None
        self.p: B = None
        self.x: G = None
        self.v: G = None
        self.u: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: F = None
        self.w: D = None
        self.q: B = None
        self.x: F = None
        self.t: A = None
        self.txt = txt

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

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

a.z = l
m.z = b
j.q = b
j.x = b
j.v = b
j.y = l
j.u = l
j.p = m
c.x = l
c.p = l
l.q = m
l.w = e
d.s = e
d.v = e
d.x = e
d.w = c
d.q = m
d.t = a
b.u = m
b.x = e
e.s = d
e.v = d
e.x = d
e.w = c
e.q = m
e.t = a
assert d.t.z.w.w.p.w.txt == "e"