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

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

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

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

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

e = A("e")
d = B("d")
f = C("f")
l = D("l")
c = E("c")
b = D("b")

e.r = b
e.q = d
d.u = f
d.w = l
f.t = c
f.u = c
f.o = l
l.r = b
l.v = b
l.s = d
l.w = d
l.o = e
c.r = e
b.r = l
b.v = l
b.s = d
b.w = d
b.o = e
assert d.w.r.v.s.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

e = A("e")
d = B("d")
f = C("f")
l = D("l")
c = E("c")
b = D("b")

e.r = b
e.q = d
d.u = f
d.w = l
f.t = c
f.u = c
f.o = l
l.r = b
l.v = b
l.s = d
l.w = d
l.o = e
c.r = e
b.r = l
b.v = l
b.s = d
b.w = d
b.o = e
assert d.w.r.v.s.w.r.txt == "b"