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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: A = None
        self.s: E = None
        self.y: A = None
        self.txt = txt

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

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

l = A("l")
k = B("k")
n = C("n")
i = D("i")
h = E("h")
b = D("b")

l.x = n
l.r = n
l.v = b
l.s = b
k.r = i
n.o = l
n.z = l
n.y = l
n.s = h
i.z = k
i.x = b
i.v = n
i.s = n
i.r = n
h.t = n
h.x = n
b.z = k
b.x = i
b.v = n
b.s = n
b.r = n
assert i.x.x.z.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: D = None
        self.r: C = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: A = None
        self.s: E = None
        self.y: A = None
        self.txt = txt

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

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

l = A("l")
k = B("k")
n = C("n")
i = D("i")
h = E("h")
b = D("b")

l.x = n
l.r = n
l.v = b
l.s = b
k.r = i
n.o = l
n.z = l
n.y = l
n.s = h
i.z = k
i.x = b
i.v = n
i.s = n
i.r = n
h.t = n
h.x = n
b.z = k
b.x = i
b.v = n
b.s = n
b.r = n
assert i.x.x.z.r.z.txt == "k"