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

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

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

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

c = A("c")
b = B("b")
n = C("n")
a = D("a")
h = A("h")
d = D("d")
l = A("l")
j = A("j")

c.t = n
c.v = n
c.u = n
c.o = b
b.o = a
b.y = n
b.v = n
n.u = b
a.s = d
h.t = n
h.v = n
h.u = n
h.o = b
d.s = a
l.t = n
l.v = n
l.u = n
l.o = b
j.t = n
j.v = n
j.u = n
j.o = b
assert a.s.s.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: C = None
        self.u: C = None
        self.o: B = None
        self.txt = txt

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

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

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

c = A("c")
b = B("b")
n = C("n")
a = D("a")
h = A("h")
d = D("d")
l = A("l")
j = A("j")

c.t = n
c.v = n
c.u = n
c.o = b
b.o = a
b.y = n
b.v = n
n.u = b
a.s = d
h.t = n
h.v = n
h.u = n
h.o = b
d.s = a
l.t = n
l.v = n
l.u = n
l.o = b
j.t = n
j.v = n
j.u = n
j.o = b
assert a.s.s.s.s.s.s.txt == "a"