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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: D = None
        self.t: C = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: D = None
        self.t: C = None
        self.p: D = None
        self.txt = txt

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

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

l.s = d
b.u = e
b.z = d
b.q = k
f.x = n
f.y = k
f.p = k
f.t = m
k.v = f
e.x = b
e.y = k
e.p = k
e.t = f
m.x = n
m.y = k
m.p = k
m.t = f
a.x = b
a.y = k
a.p = k
a.t = f
d.s = l
n.u = a
n.z = l
n.q = k
assert f.x.q.v.t.t.t.x.z.txt == "l"