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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: G = None
        self.p: A = None
        self.r: D = None
        self.y: D = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: G = None
        self.p: A = None
        self.r: D = None
        self.y: D = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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