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

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

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

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

l = A("l")
n = B("n")
a = C("a")
j = D("j")
f = D("f")

l.v = n
l.w = a
n.w = a
n.t = f
n.v = l
a.q = f
a.u = j
j.s = a
j.u = l
j.q = l
j.v = f
f.s = a
f.u = l
f.q = l
f.v = j
assert l.w.u.s.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: C = None
        self.txt = txt

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

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

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

l = A("l")
n = B("n")
a = C("a")
j = D("j")
f = D("f")

l.v = n
l.w = a
n.w = a
n.t = f
n.v = l
a.q = f
a.u = j
j.s = a
j.u = l
j.q = l
j.v = f
f.s = a
f.u = l
f.q = l
f.v = j
assert l.w.u.s.q.v.txt == "j"