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

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

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

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

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

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

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

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

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

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

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