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

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

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

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

d = A("d")
a = B("a")
i = C("i")
j = D("j")
m = C("m")
k = C("k")
c = B("c")
n = B("n")
l = A("l")

d.r = j
d.x = j
d.v = i
a.v = j
a.y = d
a.s = i
a.x = m
i.t = k
j.s = a
j.r = d
m.t = k
k.t = i
c.v = j
c.y = d
c.s = m
c.x = k
n.v = j
n.y = l
n.s = k
n.x = m
l.r = j
l.x = j
l.v = i
assert j.s.v.s.s.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.v: C = None
        self.txt = txt

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

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

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

d = A("d")
a = B("a")
i = C("i")
j = D("j")
m = C("m")
k = C("k")
c = B("c")
n = B("n")
l = A("l")

d.r = j
d.x = j
d.v = i
a.v = j
a.y = d
a.s = i
a.x = m
i.t = k
j.s = a
j.r = d
m.t = k
k.t = i
c.v = j
c.y = d
c.s = m
c.x = k
n.v = j
n.y = l
n.s = k
n.x = m
l.r = j
l.x = j
l.v = i
assert j.s.v.s.s.t.t.txt == "i"