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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: D = None
        self.z: D = None
        self.u: B = None
        self.t: D = None
        self.txt = txt

c = A("c")
l = B("l")
i = C("i")
n = D("n")
k = E("k")
j = E("j")

c.x = l
c.u = n
l.p = c
i.r = l
i.w = l
i.o = c
n.x = l
n.z = i
k.o = j
k.w = n
k.z = n
k.t = n
k.u = l
j.o = k
j.w = n
j.z = n
j.t = n
j.u = l
assert l.p.x.p.x.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: D = None
        self.z: D = None
        self.u: B = None
        self.t: D = None
        self.txt = txt

c = A("c")
l = B("l")
i = C("i")
n = D("n")
k = E("k")
j = E("j")

c.x = l
c.u = n
l.p = c
i.r = l
i.w = l
i.o = c
n.x = l
n.z = i
k.o = j
k.w = n
k.z = n
k.t = n
k.u = l
j.o = k
j.w = n
j.z = n
j.t = n
j.u = l
assert l.p.x.p.x.p.x.txt == "l"