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

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

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

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

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

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

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

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

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

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

j.u = a
j.s = l
j.v = l
j.t = i
f.w = c
f.r = j
f.s = j
a.x = i
a.u = c
a.t = k
a.y = j
i.r = n
c.u = k
c.s = b
c.t = i
c.v = f
n.r = i
k.x = i
k.u = c
k.y = c
k.t = a
l.w = j
l.r = j
l.s = c
b.w = c
b.r = c
b.s = j
assert i.r.r.r.r.r.r.r.r.r.txt == "n"