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

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

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

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

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

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

a.r = i
a.w = m
a.o = d
a.q = l
a.u = j
f.y = c
f.v = c
b.r = f
d.o = l
d.q = i
d.s = i
d.y = m
d.p = g
l.y = m
c.r = f
m.y = j
m.v = j
i.r = a
i.w = m
i.o = d
i.q = l
i.u = c
j.r = f
g.y = f
assert m.y.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: B = None
        self.o: D = None
        self.q: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

a.r = i
a.w = m
a.o = d
a.q = l
a.u = j
f.y = c
f.v = c
b.r = f
d.o = l
d.q = i
d.s = i
d.y = m
d.p = g
l.y = m
c.r = f
m.y = j
m.v = j
i.r = a
i.w = m
i.o = d
i.q = l
i.u = c
j.r = f
g.y = f
assert m.y.r.y.txt == "c"