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

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

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

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

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

g = A("g")
e = B("e")
d = C("d")
a = D("a")
l = E("l")
f = E("f")

g.u = l
g.v = l
g.w = l
e.s = a
e.o = a
e.x = g
d.o = e
d.q = e
d.u = a
a.q = g
a.s = g
a.z = f
l.z = a
l.r = d
l.q = g
l.y = g
f.z = a
f.r = d
f.q = g
f.y = g
assert l.y.v.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: E = None
        self.w: E = None
        self.txt = txt

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

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

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

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

g = A("g")
e = B("e")
d = C("d")
a = D("a")
l = E("l")
f = E("f")

g.u = l
g.v = l
g.w = l
e.s = a
e.o = a
e.x = g
d.o = e
d.q = e
d.u = a
a.q = g
a.s = g
a.z = f
l.z = a
l.r = d
l.q = g
l.y = g
f.z = a
f.r = d
f.q = g
f.y = g
assert l.y.v.r.u.txt == "a"