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

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

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

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

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

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

b.y = m
b.q = m
b.s = l
g.y = l
g.o = i
g.r = i
g.q = b
g.z = b
i.y = g
l.y = i
l.r = i
l.w = g
l.q = g
l.x = b
j.w = b
j.o = l
j.t = g
m.w = b
m.o = l
m.t = g
assert g.y.x.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: D = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

b.y = m
b.q = m
b.s = l
g.y = l
g.o = i
g.r = i
g.q = b
g.z = b
i.y = g
l.y = i
l.r = i
l.w = g
l.q = g
l.x = b
j.w = b
j.o = l
j.t = g
m.w = b
m.o = l
m.t = g
assert g.y.x.s.y.txt == "i"