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

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

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

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

e = A("e")
b = B("b")
n = C("n")
l = D("l")
m = A("m")
k = D("k")
c = B("c")
f = D("f")
j = B("j")

e.s = l
e.o = n
e.r = k
e.t = j
b.w = k
n.o = e
n.q = e
l.p = e
l.y = k
m.s = k
m.o = n
m.r = l
m.t = j
k.p = m
k.y = l
c.w = k
f.p = m
f.y = k
j.w = l
assert j.w.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: C = None
        self.r: D = None
        self.t: B = None
        self.txt = txt

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

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

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

e = A("e")
b = B("b")
n = C("n")
l = D("l")
m = A("m")
k = D("k")
c = B("c")
f = D("f")
j = B("j")

e.s = l
e.o = n
e.r = k
e.t = j
b.w = k
n.o = e
n.q = e
l.p = e
l.y = k
m.s = k
m.o = n
m.r = l
m.t = j
k.p = m
k.y = l
c.w = k
f.p = m
f.y = k
j.w = l
assert j.w.y.y.y.txt == "k"