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

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

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

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

l = A("l")
a = B("a")
g = C("g")
j = D("j")
m = B("m")
n = B("n")
k = A("k")

l.x = k
l.v = k
l.o = a
l.s = g
a.v = g
g.u = l
g.o = k
g.r = m
g.x = j
j.p = k
m.v = g
n.v = g
k.x = l
k.v = l
k.o = a
k.s = g
assert l.x.o.v.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: A = None
        self.o: B = None
        self.s: C = None
        self.txt = txt

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

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

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

l = A("l")
a = B("a")
g = C("g")
j = D("j")
m = B("m")
n = B("n")
k = A("k")

l.x = k
l.v = k
l.o = a
l.s = g
a.v = g
g.u = l
g.o = k
g.r = m
g.x = j
j.p = k
m.v = g
n.v = g
k.x = l
k.v = l
k.o = a
k.s = g
assert l.x.o.v.u.s.txt == "g"