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

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

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

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

k = A("k")
e = B("e")
n = C("n")
l = D("l")
g = B("g")
i = B("i")
a = B("a")
b = B("b")

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

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

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

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

k = A("k")
e = B("e")
n = C("n")
l = D("l")
g = B("g")
i = B("i")
a = B("a")
b = B("b")

k.u = a
k.r = n
e.s = l
e.y = n
e.x = b
e.v = b
n.t = k
n.s = e
l.x = i
l.v = i
g.s = l
g.y = n
g.x = i
g.v = e
i.s = l
i.y = n
i.x = b
i.v = a
a.s = l
a.y = n
a.x = b
a.v = i
b.s = l
b.y = n
b.x = e
b.v = g
assert n.t.r.s.x.y.t.u.v.txt == "i"