class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

e = A("e")
i = B("i")
l = C("l")
n = D("n")
k = A("k")
d = D("d")
j = C("j")

e.z = i
i.v = k
i.w = l
i.y = d
i.x = n
l.y = d
l.u = i
n.y = e
n.r = e
n.q = e
n.p = l
k.z = i
d.y = k
d.r = k
d.q = k
d.p = j
j.y = d
j.u = i
assert l.u.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

e = A("e")
i = B("i")
l = C("l")
n = D("n")
k = A("k")
d = D("d")
j = C("j")

e.z = i
i.v = k
i.w = l
i.y = d
i.x = n
l.y = d
l.u = i
n.y = e
n.r = e
n.q = e
n.p = l
k.z = i
d.y = k
d.r = k
d.q = k
d.p = j
j.y = d
j.u = i
assert l.u.x.y.txt == "e"