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

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

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

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

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

e = A("e")
i = B("i")
m = C("m")
l = D("l")
c = E("c")

e.r = c
e.y = l
e.x = i
e.v = i
i.s = c
i.t = l
m.u = l
m.r = c
m.x = i
l.u = m
c.y = e
assert i.t.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: D = None
        self.x: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

e = A("e")
i = B("i")
m = C("m")
l = D("l")
c = E("c")

e.r = c
e.y = l
e.x = i
e.v = i
i.s = c
i.t = l
m.u = l
m.r = c
m.x = i
l.u = m
c.y = e
assert i.t.u.r.txt == "c"