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

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

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

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

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

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

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

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

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

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

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

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

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