class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: B = None
        self.z: E = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: D = None
        self.x: E = None
        self.o: C = None
        self.txt = txt

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

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

k = A("k")
n = B("n")
f = C("f")
d = D("d")
c = E("c")
h = E("h")
i = C("i")
b = D("b")
l = B("l")
m = A("m")

k.s = m
k.y = l
k.z = h
k.q = f
n.w = l
f.z = i
f.o = i
f.w = b
f.x = c
d.p = b
c.t = f
h.t = i
i.z = f
i.o = f
i.w = d
i.x = c
b.p = d
l.w = n
m.s = k
m.y = n
m.z = h
m.q = i
assert l.w.w.w.w.w.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: B = None
        self.z: E = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: D = None
        self.x: E = None
        self.o: C = None
        self.txt = txt

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

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

k = A("k")
n = B("n")
f = C("f")
d = D("d")
c = E("c")
h = E("h")
i = C("i")
b = D("b")
l = B("l")
m = A("m")

k.s = m
k.y = l
k.z = h
k.q = f
n.w = l
f.z = i
f.o = i
f.w = b
f.x = c
d.p = b
c.t = f
h.t = i
i.z = f
i.o = f
i.w = d
i.x = c
b.p = d
l.w = n
m.s = k
m.y = n
m.z = h
m.q = i
assert l.w.w.w.w.w.w.w.w.w.txt == "n"