class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.t: C = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

b.s = n
b.u = a
b.t = i
b.o = i
b.y = i
n.z = i
n.s = c
i.y = b
i.q = n
a.v = f
a.s = h
f.v = i
f.y = l
l.v = d
l.s = h
d.v = i
d.y = c
h.v = d
h.s = c
c.v = f
c.s = a
assert d.v.q.s.v.txt == "f"