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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: B = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: C = None
        self.v: B = None
        self.w: B = None
        self.txt = txt

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

n = A("n")
c = B("c")
e = C("e")
b = D("b")
d = E("d")
m = B("m")
f = A("f")
l = C("l")

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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: B = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: C = None
        self.v: B = None
        self.w: B = None
        self.txt = txt

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

n = A("n")
c = B("c")
e = C("e")
b = D("b")
d = E("d")
m = B("m")
f = A("f")
l = C("l")

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