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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: D = None
        self.p: C = None
        self.t: A = None
        self.txt = txt

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

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

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

l = A("l")
f = B("f")
j = C("j")
a = D("a")
c = E("c")

l.u = a
l.v = c
f.y = a
f.z = a
f.p = j
f.t = l
j.s = a
a.y = f
a.w = f
a.r = c
a.z = j
a.q = l
c.y = f
c.o = f
c.r = j
c.p = l
c.u = l
assert j.s.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: D = None
        self.p: C = None
        self.t: A = None
        self.txt = txt

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

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

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

l = A("l")
f = B("f")
j = C("j")
a = D("a")
c = E("c")

l.u = a
l.v = c
f.y = a
f.z = a
f.p = j
f.t = l
j.s = a
a.y = f
a.w = f
a.r = c
a.z = j
a.q = l
c.y = f
c.o = f
c.r = j
c.p = l
c.u = l
assert j.s.q.u.txt == "a"