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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

e = A("e")
i = B("i")
j = C("j")
l = D("l")
d = E("d")
g = A("g")
f = D("f")
k = B("k")

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

e = A("e")
i = B("i")
j = C("j")
l = D("l")
d = E("d")
g = A("g")
f = D("f")
k = B("k")

e.z = i
e.y = i
e.s = j
i.p = l
i.x = g
i.s = g
j.u = f
j.s = f
j.v = e
l.o = e
l.w = e
l.z = f
d.q = g
g.z = k
g.y = k
g.s = j
f.o = e
f.w = e
f.z = l
k.p = l
k.x = g
k.s = e
assert e.s.v.s.v.z.x.z.txt == "k"