class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: D = None
        self.txt = txt

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

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

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

i = A("i")
n = B("n")
d = C("d")
a = D("a")
e = E("e")
l = E("l")
j = D("j")
k = D("k")

i.x = d
n.v = j
n.r = a
d.s = i
d.w = i
d.r = n
d.y = k
a.s = j
e.r = i
e.p = a
l.r = i
l.p = j
j.s = k
k.s = a
assert a.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: D = None
        self.txt = txt

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

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

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

i = A("i")
n = B("n")
d = C("d")
a = D("a")
e = E("e")
l = E("l")
j = D("j")
k = D("k")

i.x = d
n.v = j
n.r = a
d.s = i
d.w = i
d.r = n
d.y = k
a.s = j
e.r = i
e.p = a
l.r = i
l.p = j
j.s = k
k.s = a
assert a.s.s.s.txt == "a"