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

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

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

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

d = A("d")
e = B("e")
n = C("n")
c = D("c")
k = C("k")
j = A("j")
a = D("a")
i = D("i")
b = D("b")
f = B("f")

d.v = c
d.x = b
e.r = j
e.y = i
n.r = a
n.x = d
n.y = e
c.s = e
c.u = i
k.r = a
k.x = j
k.y = f
j.v = c
j.x = b
a.s = e
a.u = i
i.s = f
i.u = b
b.s = e
b.u = i
f.r = j
f.y = i
assert k.x.v.u.u.u.u.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: D = None
        self.txt = txt

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

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

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

d = A("d")
e = B("e")
n = C("n")
c = D("c")
k = C("k")
j = A("j")
a = D("a")
i = D("i")
b = D("b")
f = B("f")

d.v = c
d.x = b
e.r = j
e.y = i
n.r = a
n.x = d
n.y = e
c.s = e
c.u = i
k.r = a
k.x = j
k.y = f
j.v = c
j.x = b
a.s = e
a.u = i
i.s = f
i.u = b
b.s = e
b.u = i
f.r = j
f.y = i
assert k.x.v.u.u.u.u.s.r.txt == "j"