class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.z: B = None
        self.x: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

c.w = d
c.x = d
c.y = b
c.z = l
c.u = j
i.u = l
j.o = i
j.z = i
j.w = n
j.v = d
j.p = d
b.r = i
d.x = b
l.u = i
n.w = d
n.x = d
n.y = b
n.z = l
n.u = j
assert i.u.u.u.u.u.u.u.txt == "l"