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

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

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

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

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

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

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

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

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

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

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

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

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