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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: C = None
        self.txt = txt

l = A("l")
c = B("c")
f = C("f")
d = D("d")
i = E("i")

l.o = d
l.q = i
l.u = f
l.r = f
c.t = f
f.v = i
f.u = c
f.r = l
d.v = c
i.v = l
i.t = f
assert l.q.v.o.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: E = None
        self.u: C = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: C = None
        self.txt = txt

l = A("l")
c = B("c")
f = C("f")
d = D("d")
i = E("i")

l.o = d
l.q = i
l.u = f
l.r = f
c.t = f
f.v = i
f.u = c
f.r = l
d.v = c
i.v = l
i.t = f
assert l.q.v.o.v.t.txt == "f"