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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.t: C = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.t: C = None
        self.u: D = None
        self.txt = txt

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

m.w = g
m.u = c
m.q = b
b.y = m
b.q = g
b.o = i
b.x = l
i.z = m
i.u = g
i.q = j
g.w = l
j.p = g
j.u = g
j.o = i
j.t = i
c.w = g
c.u = m
c.q = b
l.y = c
l.q = g
l.o = i
l.x = b
assert c.w.w.y.txt == "c"