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

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

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

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

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

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

e.u = a
e.o = a
e.p = b
e.t = g
e.s = g
g.t = a
g.v = a
g.o = e
g.r = d
d.o = g
d.q = e
d.x = a
a.x = b
a.z = b
a.s = e
a.u = g
a.q = g
b.y = a
b.s = d
b.u = e
b.p = g
assert g.v.z.u.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: E = None
        self.t: B = None
        self.o: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

e.u = a
e.o = a
e.p = b
e.t = g
e.s = g
g.t = a
g.v = a
g.o = e
g.r = d
d.o = g
d.q = e
d.x = a
a.x = b
a.z = b
a.s = e
a.u = g
a.q = g
b.y = a
b.s = d
b.u = e
b.p = g
assert g.v.z.u.s.o.txt == "e"