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

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

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

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

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

a = A("a")
l = B("l")
c = C("c")
b = D("b")
k = E("k")

a.o = k
a.r = k
l.s = c
c.p = k
c.s = k
c.r = k
c.t = l
c.y = a
b.v = k
k.u = a
assert k.u.r.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

a = A("a")
l = B("l")
c = C("c")
b = D("b")
k = E("k")

a.o = k
a.r = k
l.s = c
c.p = k
c.s = k
c.r = k
c.t = l
c.y = a
b.v = k
k.u = a
assert k.u.r.u.r.txt == "k"