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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: D = None
        self.v: F = None
        self.q: F = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: D = None
        self.v: F = None
        self.q: F = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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