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

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

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

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

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

k = A("k")
i = B("i")
d = C("d")
h = D("h")
g = E("g")
a = D("a")

k.r = h
k.s = i
k.o = d
k.w = g
i.t = a
i.p = a
i.o = h
d.s = g
d.t = g
d.x = i
h.o = i
h.u = a
g.v = a
a.o = i
a.u = h
assert d.s.v.o.t.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: B = None
        self.o: C = None
        self.w: E = None
        self.txt = txt

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

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

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

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

k = A("k")
i = B("i")
d = C("d")
h = D("h")
g = E("g")
a = D("a")

k.r = h
k.s = i
k.o = d
k.w = g
i.t = a
i.p = a
i.o = h
d.s = g
d.t = g
d.x = i
h.o = i
h.u = a
g.v = a
a.o = i
a.u = h
assert d.s.v.o.t.u.u.txt == "a"