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

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

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

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

h = A("h")
d = B("d")
l = C("l")
k = D("k")
i = A("i")
a = A("a")
e = B("e")
b = B("b")

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

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

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

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

h = A("h")
d = B("d")
l = C("l")
k = D("k")
i = A("i")
a = A("a")
e = B("e")
b = B("b")

h.r = e
d.u = k
d.o = k
d.x = l
l.s = e
l.r = k
l.v = k
l.t = b
k.s = a
k.y = l
i.r = d
a.r = d
e.u = k
e.o = k
e.x = l
b.u = k
b.o = k
b.x = l
assert a.r.x.v.y.t.txt == "b"