class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: D = None
        self.u: C = None
        self.z: D = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: B = None
        self.p: A = None
        self.z: D = None
        self.u: E = None
        self.txt = txt

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

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

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

l.q = e
l.y = e
l.z = e
l.u = i
l.o = i
f.p = i
i.s = e
i.z = e
i.r = f
i.p = n
i.u = d
e.z = d
e.v = i
d.y = n
d.z = e
n.q = e
n.y = e
n.z = e
n.u = i
n.o = i
b.p = i
assert n.y.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: D = None
        self.u: C = None
        self.z: D = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: B = None
        self.p: A = None
        self.z: D = None
        self.u: E = None
        self.txt = txt

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

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

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

l.q = e
l.y = e
l.z = e
l.u = i
l.o = i
f.p = i
i.s = e
i.z = e
i.r = f
i.p = n
i.u = d
e.z = d
e.v = i
d.y = n
d.z = e
n.q = e
n.y = e
n.z = e
n.u = i
n.o = i
b.p = i
assert n.y.z.z.z.txt == "d"