class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: C = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

j = A("j")
k = B("k")
b = C("b")
g = D("g")
l = E("l")

j.w = k
j.y = k
j.o = b
k.w = g
k.z = l
k.r = j
b.w = j
g.u = j
g.w = l
g.v = k
l.w = b
l.s = k
assert j.o.w.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: C = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

j = A("j")
k = B("k")
b = C("b")
g = D("g")
l = E("l")

j.w = k
j.y = k
j.o = b
k.w = g
k.z = l
k.r = j
b.w = j
g.u = j
g.w = l
g.v = k
l.w = b
l.s = k
assert j.o.w.y.r.txt == "j"