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

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

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

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

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

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

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

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

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

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

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