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

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

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

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

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

l.o = f
l.t = d
l.u = d
d.q = l
c.q = f
c.z = k
c.r = l
c.p = e
f.s = l
k.q = l
n.q = j
e.q = f
e.z = n
e.r = l
e.p = c
j.o = f
j.t = k
j.u = d
assert l.u.q.t.q.o.s.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

l.o = f
l.t = d
l.u = d
d.q = l
c.q = f
c.z = k
c.r = l
c.p = e
f.s = l
k.q = l
n.q = j
e.q = f
e.z = n
e.r = l
e.p = c
j.o = f
j.t = k
j.u = d
assert l.u.q.t.q.o.s.t.q.txt == "l"