class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: E = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: E = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

n = A("n")
c = B("c")
f = C("f")
l = D("l")
h = E("h")
g = D("g")
i = D("i")
a = E("a")

n.u = f
n.q = c
n.r = h
c.y = f
c.w = l
f.o = h
f.s = h
f.v = c
l.w = c
l.v = f
l.z = f
l.s = a
h.q = n
h.s = a
h.w = c
h.y = f
g.w = c
g.v = f
g.z = f
g.s = a
i.w = c
i.v = f
i.z = f
i.s = h
a.q = n
a.s = h
a.w = c
a.y = f
assert f.v.w.s.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: E = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: E = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

n = A("n")
c = B("c")
f = C("f")
l = D("l")
h = E("h")
g = D("g")
i = D("i")
a = E("a")

n.u = f
n.q = c
n.r = h
c.y = f
c.w = l
f.o = h
f.s = h
f.v = c
l.w = c
l.v = f
l.z = f
l.s = a
h.q = n
h.s = a
h.w = c
h.y = f
g.w = c
g.v = f
g.z = f
g.s = a
i.w = c
i.v = f
i.z = f
i.s = h
a.q = n
a.s = h
a.w = c
a.y = f
assert f.v.w.s.s.q.txt == "n"