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

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

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

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

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

b.s = m
b.p = m
b.y = l
h.q = e
h.u = l
h.t = a
e.q = l
e.u = l
e.o = l
n.t = b
n.w = l
n.v = e
l.q = e
l.u = e
l.o = e
d.q = l
d.u = l
d.t = h
m.s = b
m.p = b
m.y = e
k.q = e
k.u = l
k.t = h
a.q = e
a.u = e
a.t = d
assert e.o.q.q.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: A = None
        self.y: C = None
        self.txt = txt

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

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

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

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

b.s = m
b.p = m
b.y = l
h.q = e
h.u = l
h.t = a
e.q = l
e.u = l
e.o = l
n.t = b
n.w = l
n.v = e
l.q = e
l.u = e
l.o = e
d.q = l
d.u = l
d.t = h
m.s = b
m.p = b
m.y = e
k.q = e
k.u = l
k.t = h
a.q = e
a.u = e
a.t = d
assert e.o.q.q.o.o.o.o.txt == "l"