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

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

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

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

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

b.o = j
b.w = n
b.s = n
b.v = l
a.t = l
a.x = j
a.o = j
a.s = g
l.u = n
j.w = n
j.p = n
k.t = l
k.x = j
k.o = j
k.s = d
d.t = l
d.x = j
d.o = j
d.s = a
g.t = l
g.x = j
g.o = j
g.s = k
n.o = j
n.w = b
n.s = b
n.v = l
assert a.s.s.t.u.o.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: A = None
        self.v: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

b.o = j
b.w = n
b.s = n
b.v = l
a.t = l
a.x = j
a.o = j
a.s = g
l.u = n
j.w = n
j.p = n
k.t = l
k.x = j
k.o = j
k.s = d
d.t = l
d.x = j
d.o = j
d.s = a
g.t = l
g.x = j
g.o = j
g.s = k
n.o = j
n.w = b
n.s = b
n.v = l
assert a.s.s.t.u.o.p.v.txt == "l"