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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: D = None
        self.u: C = None
        self.t: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: D = None
        self.u: C = None
        self.t: B = None
        self.txt = txt

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

k.v = l
k.w = c
k.u = b
i.u = f
i.y = f
i.q = c
i.r = n
c.t = l
l.w = i
l.r = n
l.u = c
l.t = b
n.w = f
n.t = f
n.r = l
n.u = c
f.u = b
f.y = i
f.q = c
f.r = n
b.u = i
b.y = f
b.q = c
b.r = n
assert c.t.t.q.t.r.r.txt == "l"