class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.s: C = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: C = None
        self.x: G = None
        self.z: E = None
        self.o: A = None
        self.txt = txt

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

e = A("e")
h = B("h")
n = C("n")
l = D("l")
g = E("g")
i = F("i")
m = G("m")

e.u = g
e.z = g
e.s = n
e.q = m
h.y = m
n.y = g
n.q = g
n.v = i
n.s = i
n.x = l
n.z = l
n.w = h
l.v = h
l.y = h
l.x = n
g.w = i
i.v = m
i.x = m
i.q = n
i.z = g
i.o = e
m.p = i
m.z = n
m.s = h
m.v = h
assert m.p.v.v.y.s.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.s: C = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: C = None
        self.x: G = None
        self.z: E = None
        self.o: A = None
        self.txt = txt

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

e = A("e")
h = B("h")
n = C("n")
l = D("l")
g = E("g")
i = F("i")
m = G("m")

e.u = g
e.z = g
e.s = n
e.q = m
h.y = m
n.y = g
n.q = g
n.v = i
n.s = i
n.x = l
n.z = l
n.w = h
l.v = h
l.y = h
l.x = n
g.w = i
i.v = m
i.x = m
i.q = n
i.z = g
i.o = e
m.p = i
m.z = n
m.s = h
m.v = h
assert m.p.v.v.y.s.y.z.txt == "n"