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

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

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

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

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

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

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

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

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

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

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

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

k.o = g
k.r = l
k.v = c
g.y = j
g.q = j
l.r = c
c.o = l
c.u = k
c.s = g
j.y = k
j.v = c
j.x = c
j.w = l
j.o = g
assert g.y.o.y.txt == "j"