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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

b.r = l
b.s = e
b.t = g
l.z = b
m.o = g
m.v = b
m.t = l
g.x = d
g.w = l
g.y = m
g.v = e
g.z = b
d.y = l
i.y = l
e.o = g
e.v = b
e.t = l
assert b.s.v.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: C = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

b.r = l
b.s = e
b.t = g
l.z = b
m.o = g
m.v = b
m.t = l
g.x = d
g.w = l
g.y = m
g.v = e
g.z = b
d.y = l
i.y = l
e.o = g
e.v = b
e.t = l
assert b.s.v.r.z.txt == "b"