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

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

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

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

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

k = A("k")
f = B("f")
c = C("c")
j = D("j")
l = E("l")
n = A("n")
d = E("d")

k.x = j
f.v = j
f.s = c
c.u = l
c.t = l
j.z = c
j.v = c
l.x = j
l.u = d
l.r = f
l.s = c
n.x = j
d.x = j
d.u = l
d.r = f
d.s = c
assert l.u.r.s.t.r.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

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

k = A("k")
f = B("f")
c = C("c")
j = D("j")
l = E("l")
n = A("n")
d = E("d")

k.x = j
f.v = j
f.s = c
c.u = l
c.t = l
j.z = c
j.v = c
l.x = j
l.u = d
l.r = f
l.s = c
n.x = j
d.x = j
d.u = l
d.r = f
d.s = c
assert l.u.r.s.t.r.v.z.txt == "c"