class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.w: B = None
        self.o: C = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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

i.p = d
i.q = d
i.w = n
i.t = n
i.o = b
n.t = d
b.q = d
l.x = b
l.t = b
l.y = n
l.u = n
d.q = b
d.v = n
assert d.v.t.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.w: B = None
        self.o: C = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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

i.p = d
i.q = d
i.w = n
i.t = n
i.o = b
n.t = d
b.q = d
l.x = b
l.t = b
l.y = n
l.u = n
d.q = b
d.v = n
assert d.v.t.v.t.txt == "d"