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

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

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

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

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

c = A("c")
b = B("b")
d = C("d")
g = D("g")
k = E("k")

c.s = d
c.t = d
c.w = d
c.r = k
c.q = b
b.v = d
b.q = d
d.y = g
d.u = g
d.z = k
g.o = b
g.v = b
g.r = d
k.v = g
k.u = g
k.w = d
assert c.r.u.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: E = None
        self.q: B = None
        self.t: C = None
        self.w: C = None
        self.txt = txt

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

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

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

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

c = A("c")
b = B("b")
d = C("d")
g = D("g")
k = E("k")

c.s = d
c.t = d
c.w = d
c.r = k
c.q = b
b.v = d
b.q = d
d.y = g
d.u = g
d.z = k
g.o = b
g.v = b
g.r = d
k.v = g
k.u = g
k.w = d
assert c.r.u.r.y.txt == "g"